Moving Users

Moves the specified User object into the given target container.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


Move the User "Adam Sam" from the container "Managed Users & Computers\solys.local\Chicago\ITService\Users" into the container "Managed Users & Computers\solys.local\Chicago\ITGlobal\Users" using the method MoveTo():


$MyUser = Get-EmdbUser "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users\Adam Sam"

$MyDestinationContainer = Get-EmdbOrganizationalUnit "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITGlobal\Users"

$MyUser.MoveTo($MyDestinationContainer)


Move the User "Adam Sam" from the container "Managed Users & Computers\solys.local\Chicago\ITService\Users" into the container "Managed Users & Computers\solys.local\Chicago\ITGlobal\Users" using the cmdlet Move-Item:


Move-Item -Path "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Users\Adam Sam" -Destination "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITGlobal\Users"