Commands › Exchange Online

Get-OrganizationalUnit

Exchange Online ExchangeOnlineManagement Get-*

View a list of organizational units (OUs) that exist in your organization.

Quick start script

# Get-OrganizationalUnit — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-OrganizationalUnit | Format-List

# 3. Export for evidence / drift tracking
Get-OrganizationalUnit | Export-Clixml .\OrganizationalUnit-$(Get-Date -Format yyyyMMdd).xml

Syntax — 2 parameter sets

Identity

Get-OrganizationalUnit [[-Identity] <ExtendedOrganizationalUnitIdParameter>]
 [-SingleNodeOnly]
 [-DomainController <Fqdn>]
 [-IncludeContainers]
 [-ResultSize <Unlimited>]
 [<CommonParameters>]

Search

Get-OrganizationalUnit [-SearchText <String>]
 [-DomainController <Fqdn>]
 [-IncludeContainers]
 [-ResultSize <Unlimited>]
 [<CommonParameters>]

Parameters (6)

ParameterTypeRequiredWhat it controls
-Identity ExtendedOrganizationalUnitIdParameter The Identity parameter specifies the OU or domain that you want to view. You can use any value that uniquely identifies the OU or domain. For example:
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-IncludeContainers SwitchParameter The IncludeContainers switch instructs the command to return containers in the results. You don't need to specify a value with this switch.
-SingleNodeOnly SwitchParameter The SingleNodeOnly switch instructs the command to return only the first level child OUs beneath the OU specified in the Identity parameter. You don't need to specify a value with this switch.
-ResultSize Unlimited The ResultSize parameter specifies the maximum number of results to return. If you want to return all requests that match the query, use unlimited for the value of this parameter. The default value is 1000.
-SearchText String The SearchText parameter enables you to search the names of all OUs in your organization for the specified string. Only the OUs that match the string you specify are returned. If the string you specify contains...

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.