Get-MsolAdministrativeUnit

Gets administrative units from Azure Active Directory.

Syntax

Get-MsolAdministrativeUnit
   [-UserObjectId <Guid>]
   [-UserPrincipalName <String>]
   [-SearchString <String>]
   [-MaxResults <Int32>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolAdministrativeUnit
   -ObjectId <Guid>
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolAdministrativeUnit
   [-UserObjectId <Guid>]
   [-UserPrincipalName <String>]
   [-SearchString <String>]
   [-All]
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Get-MsolAdministrativeUnit cmdlet gets administrative units from Azure Active Directory.

Examples

Example 1: Get all administrative units

PS C:\> Get-MsolAdministrativeUnit

This command gets all of the administrative units in the tenant of the currently authenticated user.

Example 2: Get an administrative unit by name

PS C:\> Get-MsolAdministrativeUnit -SearchString "West Coast"

This command get the administrative unit called West Coast.

Example 3: Get an administrative unit by user principal name

Get-MsolAdministrativeUnit -UserPrincipalName "pattifuller@contoso.com"

This command gets the administrative units in which pattifuller@contoso.com is a member.

Parameters

-All

Indicates that this cmdlet returns all results that it finds. Do not specify this parameter and the MaxResults parameter.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MaxResults

Specifies the maximum number of results that this cmdlet returns.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ObjectId

Specifies the unique ID of an administrative unit to return.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SearchString

Specifies a string. This cmdlet returns administrative units that have a display name that start with this string.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-UserObjectId

Specifies the unique ID of a user. This cmdlet returns administrative units to which this user belongs.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UserPrincipalName

Specifies a user principal name. This cmdlet returns administrative units to which this user belongs.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False