Move-SPUser

在 SharePoint 产品中迁移用户帐户。

语法

Move-SPUser
    [-Identity] <SPUserPipeBind>
    -NewAlias <String>
    [-AssignmentCollection <SPAssignmentCollection>]
    [-Confirm]
    [-IgnoreSID]
    [-WhatIf]
    [<CommonParameters>]

说明

The Move-SPUser cmdlet migrates user access from one domain user account to another. If an entry for the new login name already exists, the entry is marked for deletion to make way for the migration.

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

------------------示例------------------

$user = Get-SPUser -Identity "DOMAIN\JaneDoe" -Web https://webUrl
Move-SPUser -Identity $user -NewAlias "Domain\JaneSmith" -IgnoreSid

此示例将 DOMAIN\JaneDoe 迁移到新帐户 DOMAIN\JaneSmith。

------------------示例 2------------------

$user = Get-SPUser -Identity "DomainA\JaneDoe" -Web https://webUrl
Move-SPUser -Identity $user -NewAlias "DomainB\JaneDoe"

本示例将 DOMAIN\JaneDoe 从 DomainA 迁移到已启用 SID 历史记录的 DomainB\JaneDoe 的新帐户。

------------------示例 3------------------

$user = Get-SPUser -Identity "i:0#.w|DOMAIN\JaneDoe" -Web https://webUrl
Move-SPUser -Identity $user -NewAlias "i:0#.w|Domain\JaneSmith" -IgnoreSid

本示例在使用 Windows 声明时将 DOMAIN\JaneDoe 迁移到 DOMAIN\JaneSmith 的新帐户。 -IgnoreSid 使用声明标识(如 Windows 声明)时,必须始终使用 Move-SPUser 声明标识。

参数

-Confirm

执行命令前,看到确认提示。 有关详细信息,请键入以下命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定通过 Get-SPUser>SPUsera0>检索的对象。

该类型必须是有效的 SPUser 对象。

Type:SPUserPipeBind
Aliases:UserAlias
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-IgnoreSID

指示(如果存在)将不会在 Active Directory 中查询 SID 历史记录属性,以确保新登录名与旧登录名相对应。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-NewAlias

指定用户帐户的新登录名。

该类型必须是有效的登录名,格式为 DOMAIN\username。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition