Thursday, February 24, 2011

Moving the Objects in an OU to a Different OU

Moving the Objects in an OU to a Different OU

This topic explains how to use the Active Directory module for Windows PowerShell to move objects in an organizational unit (OU) to a different OU.

Example

The following example demonstrates how to move the objects in the OU ManagedGroups to the OU Managed in the Fabrikam.com domain:
Get-ADObject -Filter 'Name -like "*"' -Searchbase 'OU=ManagedGroups,DC=Fabrikam,DC=com' -SearchScope OneLevel | Move-ADObject -TargetPath "OU=Managed,DC=Fabrikam,DC=com"

Additional information

For a full explanation of the parameters that you can pass to Get-ADObject or Move-ADObject, at the Active Directory module command prompt, type Get-Help Get-ADObject –detailed or Get-Help Move-ADObject, and then press ENTER.

No comments:

Post a Comment