Thursday, February 24, 2011

Renaming an OU,Finding an OU,Modifying an OU,Moving an OU

Renaming an OU

This topic explains how to use the Active Directory module for Windows PowerShell to rename an organizational unit (OU).

Example

The following example demonstrates how to rename the OU ManagedGroups to Groups in the Fabrikam.com domain:
Rename-ADObject "OU=ManagedGroups,OU=Managed,DC=Fabrikam,DC=Com" -NewName Groups

Additional information

The following property value is used when you rename an Active Directory object:
  • NewName
For a full explanation of the parameters that you can pass to Rename-ADObject, at the Active Directory module command prompt, type Get-Help Rename-ADObject -detailed, and then press ENTER.

Finding an OU

This topic explains how to use the Active Directory module for Windows PowerShell to find an organizational unit (OU).

Example

The following example demonstrates how to find the OU Test in the Fabrikam.com domain:
Get-ADOrganizationalUnit -Identity Test, | ft Name,Country,PostalCode,City,StreetAddress,State -A

Additional information

In addition to the standard Lightweight Directory Access Protocol (LDAP) attributes, you can retrieve the following extended properties of the Get-ADOrganizationalUnit cmdlet by using the -Properties parameter:
  • StreetAddress
  • City
  • State
  • Country
  • PostalCode
  • Description
  • DisplayName
  • ProtectedFromAccidentalDeletion
  • AppliedGroupPolicies
For a full explanation of the parameters that you can pass to Get-ADOrganizationalUnit, at the Active Directory module command prompt, type Get-Help Get-ADOrganizationalUnit –detailed, and then press ENTER.


Modifying an OU

This topic explains how to use the Active Directory module for Windows PowerShell to modify an attribute of an organizational unit (OU).

Example

The following example demonstrates how to modify the description attribute of the OU Accounting in the Fabrikam.com domain:
Set-ADOrganizationalUnit –Identity Accounting -Description "Accounting Department"

Additional information

You can use the following parameters when you set many of the common values that are associated with the modification an OU:
  • Country
  • City
  • PostalCode
  • State
  • StreetAddress
  • Description
  • DisplayName
  • ProtectedFromAccidentalDeletion
  • ManagedBy
For a full explanation of the parameters that you can pass to Set-ADObject, at the Active Directory module command prompt, type Get-Help Set-ADObject -detailed, and then press ENTER.

Moving an OU

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

Example

The following example demonstrates how to move the OU ManagedGroups to the OU Managed:
Move-ADObject "OU=ManagedGroups,DC=Fabrikam,DC=Com" -TargetPath "OU=Managed,DC=Fabrikam,DC=Com"
If the Protect from Accidental Deletion option is enabled on the OU to be moved, an “Access denied” message appears when you attempt to perform this operation.

Additional information

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

No comments:

Post a Comment