Get-EntraAdministrativeUnit
Gets an administrative unit.
Syntax
Get-EntraAdministrativeUnit
[-Top <Int32>]
[-All]
[-Filter <String>]
[-Property <String[]>]
[<CommonParameters>]
Get-EntraAdministrativeUnit
-AdministrativeUnitId <String>
[-All]
[-Property <String[]>]
[<CommonParameters>]
Description
The Get-EntraAdministrativeUnit
cmdlet gets a Microsoft Entra ID administrative unit. Specify AdministrativeUnitId
parameter to get a specific administrative unit.
Examples
Example 1: Get all administrative units
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraAdministrativeUnit
DeletedDateTime Id Description DisplayName Visibility
--------------- -- ----------- ----------- ----------
dddddddd-3333-4444-5555-eeeeeeeeeeee Updated Description Updated DisplayName
cccccccc-2222-3333-4444-dddddddddddd testdemo test1
bbbbbbbb-1111-2222-3333-cccccccccccc TestAU
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test_130624_09
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb demotest test111
This command gets all the administrative units.
Example 2: Get all administrative units using '-All' parameter
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraAdministrativeUnit -All
DeletedDateTime Id Description DisplayName Visibility
--------------- -- ----------- ----------- ----------
dddddddd-3333-4444-5555-eeeeeeeeeeee Updated Description Updated DisplayName
cccccccc-2222-3333-4444-dddddddddddd testdemo test1
bbbbbbbb-1111-2222-3333-cccccccccccc TestAU
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test_130624_09
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb demotest test111
This command gets all the administrative units.
Example 3: Get a specific administrative unit
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraAdministrativeUnit -AdministrativeUnitId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb'
DeletedDateTime Id Description DisplayName Visibility
--------------- -- ----------- ----------- ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Updated Description Updated DisplayName
This example returns the details of the specified administrative unit.
-AdministrativeUnitId
parameter specifies the ID of an administrative unit.
Example 4: Get administrative units filter by display name
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraAdministrativeUnit -Filter "DisplayName eq 'DAU-Test'"
DeletedDateTime Id Description DisplayName Visibility
--------------- -- ----------- ----------- ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Dynamic AU testing in CORP tenant DAU-Test
This example list of administrative units containing display name with the specified name.
Example 5: Get top one administrative unit
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraAdministrativeUnit -Top 1
DeletedDateTime Id Description DisplayName Visibility
--------------- -- ----------- ----------- ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Dynamic AU testing in CORP tenant DAU-Test
This example returns the specified top administrative units.
Parameters
-AdministrativeUnitId
Specifies the ID of an administrative unit in Microsoft Entra ID.
Type: | System.String |
Aliases: | ObjectId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-All
List all pages.
Type: | System.Management.Automation.SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Filter
Specifies an OData v4.0 filter statement. This parameter filters which objects are returned.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Property
Specifies properties to be returned.
Type: | System.String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Top
Specifies the maximum number of records to return.
Type: | System.Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |