PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Get-ADOrganizationalUnit', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Gets one or more Active Directory organizational units.


Get-ADOrganizationalUnit [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Properties <String[]>] [-ResultPageSize <Int32>] [-ResultSetSize <Int32>]
[-SearchBase <String>] [-SearchScope {Base | OneLevel | Subtree}] [-Server <String>] -Filter <String> [<CommonParameters>]
Get-ADOrganizationalUnit [-Identity] <ADOrganizationalUnit> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Partition <String>] [-Properties <String[]>]
[-Server <String>] [<CommonParameters>]
Get-ADOrganizationalUnit [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Properties <String[]>] [-ResultPageSize <Int32>] [-ResultSetSize <Int32>]
[-SearchBase <String>] [-SearchScope {Base | OneLevel | Subtree}] [-Server <String>] -LDAPFilter <String> [<CommonParameters>]

Search powershellhelp.space


The Get-ADOrganizationalUnit cmdlet gets an organizational unit object or performs a search to retrieve multiple organizational units.

The Identity parameter specifies the Active Directory organizational unit to retrieve. You can identify an organizational unit by its distinguished name (DN) or GUID. You
can also set the parameter to an organizational unit object variable, such as $<localOrganizationalunitObject> or pass an organizational unit object through the pipeline to
the Identity parameter.

To search for and retrieve more than one organizational unit, use the Filter or LDAPFilter parameters. The Filter parameter uses the PowerShell Expression Language to write
query strings for Active Directory. PowerShell Expression Language syntax provides rich type conversion support for value types received by the Filter parameter. For more
information about the Filter parameter syntax, type Get-Help about_ActiveDirectory_Filter. If you have existing LDAP query strings, you can use the LDAPFilter parameter.

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



Online Version: http://go.microsoft.com/fwlink/p/?linkid=291036




-------------------------- EXAMPLE 1 --------------------------

PS C:\>Get-ADOrganizationalUnit -Filter 'Name -like "*"' | Format-Table Name, DistinguishedName -A
Name DistinguishedName
---- -----------------
Domain Controllers OU=Domain Controllers,DC=FABRIKAM,DC=COM
UserAccounts OU=UserAccounts,DC=FABRIKAM,DC=COM
Sales OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM
Marketing OU=Marketing,OU=UserAccounts,DC=FABRIKAM,DC=COM
Production OU=Production,OU=UserAccounts,DC=FABRIKAM,DC=COM
HumanResources OU=HumanResources,OU=UserAccounts,DC=FABRIKAM,DC=COM
NorthAmerica OU=NorthAmerica,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM
SouthAmerica OU=SouthAmerica,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM
Europe OU=Europe,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM
AsiaPacific OU=AsiaPacific,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM
Finance OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM
Corporate OU=Corporate,OU=UserAccounts,DC=FABRIKAM,DC=COM
ApplicationServers OU=ApplicationServers,DC=FABRIKAM,DC=COM
Groups OU=Groups,OU=Managed,DC=FABRIKAM,DC=COM
PasswordPolicyGroups OU=PasswordPolicyGroups,OU=Groups,OU=Managed,DC=FABRIKAM,DC=COM
ServiceAccounts OU=ServiceAccounts,OU=Managed,DC=FABRIKAM,DC=COM

This command gets all the Organizational Units in the domain.

-------------------------- EXAMPLE 2 --------------------------

PS C:\>Get-ADOrganizationalUnit -Identity 'OU=AsiaPacific,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM' | Format-Table Name,Country,PostalCode,City,StreetAddress,State -A
Name Country PostalCode City StreetAddress State
---- ------- ---------- ---- ------------- -----
AsiaPacific AU 4171 Balmoral 45 Martens Place QLD

This command gets the Organizational Unit with DistinguishedName OU=AsiaPacific,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM.

-------------------------- EXAMPLE 3 --------------------------

PS C:\>Get-ADOrganizationalUnit -LDAPFilter '(name=*)' -SearchBase 'OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM' -SearchScope OneLevel | Format-Table
Name Country PostalCode City StreetAddress State
---- ------- ---------- ---- ------------- -----
AsiaPacific AU 4171 Balmoral 45 Martens Place QLD
Europe UK NG34 0NI QUARRINGTON 22 Station Rd
NorthAmerica US 02142 Cambridge 1634 Randolph Street MA

This command gets Organizational Units underneath the sales Organizational Unit using an LDAP filter.