Listing the OUs in a Domain
This topic explains how to use the Active Directory module for Windows PowerShell to enumerate all the organizational units (OUs) in a domain.
Example
The following example demonstrates how to enumerate all the OUs in the Fabrikam.com domain:
Get-ADOrganizationalUnit -Filter {Name -like '*'} | FT Name, DistinguishedName -A
Get-ADOrganizationalUnit -Filter {Name -like '*'} | FT Name, DistinguishedName -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
No comments:
Post a Comment