Home » General » Gets one or more Active Directory organizational units

Gets one or more Active Directory organizational units

Description

The Get-ADOrganizationalUnit cmdlet gets an organizational unit (OU) object or performs a search to get multiple OUs.

This cmdlet gets a default set of OU object properties. To get additional properties, use the Properties parameter. For more information about the how to determine the properties for computer objects, see the Properties parameter description.

 

Examples:
Get all of the OUs in a domain
Get-ADOrganizationalUnit -Filter ‘Name -like “*”‘ | Format-Table Name, DistinguishedName -A

Get child OUs
Get-ADOrganizationalUnit -LDAPFilter ‘(name=*)’ -SearchBase ‘OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM’ -SearchScope OneLevel | Format-Table Name,Country,PostalCode,City,StreetAddress,Stat

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *
Website