Convert-SPWebApplication
转换 Web 应用程序的身份验证模式。
语法
Default (默认值)
Convert-SPWebApplication
-Identity <SPWebApplicationPipeBind>
-From <String>
-To <String>
[-AssignmentCollection <SPAssignmentCollection>]
[-Force]
[-RetainPermissions]
[-Database <SPContentDatabase>]
[-MapList <String>]
[-SiteSubsriptionId <Guid>]
[-SkipPolicies]
[-SkipSites]
[-SourceSkipList <String>]
[-TrustedProvider <SPTrustedIdentityTokenIssuerPipeBind>]
[-LoggingDirectory <String>]
[<CommonParameters>]
说明
使用 Convert-SPWebApplication cmdlet 可将 Web 应用程序的身份验证模式转换为 Windows 声明身份验证模式,并将内容数据库中的用户帐户迁移到经过声明编码的值中。
保留权限时,仅当 SharePoint 启用并查询源帐户时,才会转换网站中的用户。 例如,如果在经典 Windows 到 Windows 声明转换之前删除或禁用 Active Directory 帐户,则数据库中的帐户不会更新为声明格式。
有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet。
示例
示例 1
Convert-SPWebApplication -Identity "https://<webappurl>" -To Claims -RetainPermissions
此示例将 Identity 参数指定的 Web 应用程序转换为使用声明身份验证模式。
示例 2
Convert-SPWebApplication -Identity "https://<webappurl>" -From Legacy -To Claims -RetainPermissions
本示例将 Identity 参数指定的 Web 应用程序从经典Windows 身份验证转换为声明身份验证模式,同时保留权限。 应用安全更新 MS04-022 或 SharePoint Server 2013 2014 年 4 月累积更新后,需要 -From 参数。 这是所有版本的 SharePoint Server 2016 所必需的。
参数
-AssignmentCollection
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
在使用 Global 参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。
参数属性
| 类型: | SPAssignmentCollection |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Database
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要迁移的内容数据库的名称。
参数属性
| 类型: | SPContentDatabase |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Force
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
强制转换 Web 应用程序。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-From
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要从中转换的身份验证方法。
此参数的有效值如下所示。
旧版、Claims-Windows、Claims-Trusted-Default
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Identity
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要转换的 Web 应用程序的 URL,例如:https://mysite/app1
参数属性
| 类型: | SPWebApplicationPipeBind |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-LoggingDirectory
适用:SharePoint Server 2016,SharePoint Server 2019
指定将写入有关迁移结果的详细日志的目录。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-MapList
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定一个文件,其中包含以下格式的行列表:user-key、migrated-user-name、migrated-user-key。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-RetainPermissions
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定用于运行 cmdlet 的帐户,并保留 Web 应用程序中的权限。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-SiteSubsriptionId
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定网站订阅的 GUID。
参数属性
| 类型: | Guid |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-SkipPolicies
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定不会迁移 SPWebApplication 安全策略。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-SkipSites
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定不会迁移 SPWebApplication 的 SPSites。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-SourceSkipList
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定一个文件,其中包含以下格式的行列表:user-key。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-To
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定要转换为的身份验证方法。
此参数的有效值如下所示。
Claims、Claims-Windows、Claims-Trusted-Default、Claims-SharePoint-Online
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-TrustedProvider
适用:SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
从受信任的登录提供程序迁移时,这是指定哪个受信任的登录提供程序的方式。
参数属性
| 类型: | SPTrustedIdentityTokenIssuerPipeBind |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。