Get-​Msol​Administrative​Unit

Gets administrative units from Azure Active Directory.

Syntax

Get-MsolAdministrativeUnit
   [-UserObjectId <Guid>]
   [-UserPrincipalName <String>]
   [-SearchString <String>]
   [-MaxResults <Int32>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolAdministrativeUnit
   [-UserObjectId <Guid>]
   [-UserPrincipalName <String>]
   [-SearchString <String>]
   [-TenantId <Guid>]
   [-All]
   [<CommonParameters>]
Get-MsolAdministrativeUnit
   [-TenantId <Guid>]
   -ObjectId <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.

Required 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
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-MaxResults

Specifies the maximum number of results that this cmdlet returns.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
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
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
Accept pipeline input:True (ByPropertyName)
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
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
Accept pipeline input:False
Accept wildcard characters:False