Convert-SPWebApplication
转换 Web 应用程序的身份验证模式。
语法
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
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
在使用 Global 参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Database
指定要迁移的内容数据库的名称。
Type: | SPContentDatabase |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Force
强制转换 Web 应用程序。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-From
指定要从中转换的身份验证方法。
此参数的有效值如下所示。
旧版、Claims-Windows、Claims-Trusted-Default
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Identity
指定要转换的 Web 应用程序的 URL,例如:https://mysite/app1
Type: | SPWebApplicationPipeBind |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-LoggingDirectory
指定将写入有关迁移结果的详细日志的目录。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2016, SharePoint Server 2019 |
-MapList
指定一个文件,其中包含以下格式的行列表:user-key、migrated-user-name、migrated-user-key。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-RetainPermissions
指定用于运行 cmdlet 的帐户,并保留 Web 应用程序中的权限。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-SiteSubsriptionId
指定网站订阅的 GUID。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-SkipPolicies
指定不会迁移 SPWebApplication 安全策略。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-SkipSites
指定不会迁移 SPWebApplication 的 SPSites。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-SourceSkipList
指定一个文件,其中包含以下格式的行列表:user-key。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-To
指定要转换为的身份验证方法。
此参数的有效值如下所示。
Claims、Claims-Windows、Claims-Trusted-Default、Claims-SharePoint-Online
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-TrustedProvider
从受信任的登录提供程序迁移时,这是指定哪个受信任的登录提供程序的方式。
Type: | SPTrustedIdentityTokenIssuerPipeBind |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |