Get-EntraUserAdministrativeUnit   
	Retrieves the list of administrative units a user belongs to.
Syntax
		GetQuery (Default)
	 
	Get-EntraUserAdministrativeUnit
    -UserId <String>
    [-All]
    [-Top <Int32>]
    [-Property <String[]>]
    [-Filter <String>]
    [<CommonParameters>]
	
		GetById
	 
	Get-EntraUserAdministrativeUnit
    -UserId <String>
    -AdministrativeUnitId <String>
    [-Property <String[]>]
    [<CommonParameters>]
	Description
The Get-EntraUserAdministrativeUnit cmdlet retrieves a list of administrative units to which a user belongs.
Examples
Example 1: Get a list of administrative units to which a specific user belongs
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraUserAdministrativeUnit -UserId 'SawyerM@contoso.com'
DeletedDateTime Id                                   Description                            DisplayName             Visibility
--------------- --                                   -----------                            -----------             ----------
                dddddddd-3333-4444-5555-eeeeeeeeeeee Pacific Administrative Unit            Pacific Admin Unit
                aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Engineering Administrative Unit        Engineering Admin Unit
This cmdlet retrieves a list of administrative units to which a specific user belongs.
Example 2: Get a list of administrative units to which a specific user belongs using the All parameter
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraUserAdministrativeUnit -UserId 'SawyerM@contoso.com' -All
DeletedDateTime Id                                   Description                            DisplayName             Visibility
--------------- --                                   -----------                            -----------             ----------
                dddddddd-3333-4444-5555-eeeeeeeeeeee Pacific Administrative Unit            Pacific Admin Unit
                aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Engineering Administrative Unit        Engineering Admin Unit
This cmdlet retrieves a list of administrative units to which a specific user belongs using the All parameter.
Example 3: Get an administrative unit to which a specific user belongs
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraUserAdministrativeUnit -UserId 'SawyerM@contoso.com' -Top 1
DeletedDateTime Id                                   Description                            DisplayName             Visibility
--------------- --                                   -----------                            -----------             ----------
                dddddddd-3333-4444-5555-eeeeeeeeeeee Pacific Administrative Unit            Pacific Admin Unit
This cmdlet retrieves an administrative unit to which a specific user belongs. You can use -Limit as an alias for -Top.
Example 4: Get a list of administrative units to which a specific user belongs using the Administrative Unit ID parameter
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
$administrativeUnit = Get-EntraAdministrativeUnit -Filter "DisplayName eq 'Pacific Admin Unit'"
Get-EntraUserAdministrativeUnit -UserId 'SawyerM@contoso.com' -AdministrativeUnitId $administrativeUnit.Id
DeletedDateTime Id                                   Description                            DisplayName             Visibility
--------------- --                                   -----------                            -----------             ----------
                dddddddd-3333-4444-5555-eeeeeeeeeeee Pacific Administrative Unit            Pacific Admin Unit
This cmdlet retrieves a list of administrative units to which a specific user belongs using the Administrative Unit ID parameter.
-AdministrativeUnitIdparameter specifies the administrative unit ID.
Example 5: Get an administrative unit to which a specific user belongs
Connect-Entra -Scopes 'AdministrativeUnit.Read.All'
Get-EntraUserAdministrativeUnit -UserId 'SawyerM@contoso.com' -Filter "Id eq 'dddddddd-3333-4444-5555-eeeeeeeeeeee'"
DeletedDateTime Id                                   Description                            DisplayName             Visibility
--------------- --                                   -----------                            -----------             ----------
                dddddddd-3333-4444-5555-eeeeeeeeeeee Pacific Administrative Unit            Pacific Admin Unit
This cmdlet retrieves an administrative unit to which a specific user belongs.
Parameters
-AdministrativeUnitId  
		The unique ID of the administrative unit.
Parameter properties
| Type: | System.String | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
| Aliases: | DirectoryObjectId | 
Parameter sets
					GetQuery 
					
				 
				| Position: | Named | 
| Mandatory: | True | 
| Value from pipeline: | True | 
| Value from pipeline by property name: | True | 
| Value from remaining arguments: | False | 
-All
List all pages.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter | 
| Default value: | False | 
| Supports wildcards: | False | 
| DontShow: | False | 
Parameter sets
(All)
| Position: | Named | 
| Mandatory: | False | 
| Value from pipeline: | False | 
| Value from pipeline by property name: | False | 
| Value from remaining arguments: | False | 
-Filter
Specifies an OData v4.0 filter statement. This parameter controls which objects are returned.
Parameter properties
| Type: | System.String | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
Parameter sets
					GetQuery 
					
				 
				| Position: | Named | 
| Mandatory: | False | 
| Value from pipeline: | True | 
| Value from pipeline by property name: | True | 
| Value from remaining arguments: | False | 
-Property
Specifies properties to be returned
Parameter properties
| Type: | System.String[]  | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
| Aliases: | Select | 
Parameter sets
(All)
| Position: | Named | 
| Mandatory: | False | 
| Value from pipeline: | False | 
| Value from pipeline by property name: | False | 
| Value from remaining arguments: | False | 
-Top
The maximum number of administrative units a user belongs to.
Parameter properties
| Type: | System.Int32 | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
| Aliases: | Limit | 
Parameter sets
					GetQuery 
					
				 
				| Position: | Named | 
| Mandatory: | False | 
| Value from pipeline: | True | 
| Value from pipeline by property name: | True | 
| Value from remaining arguments: | False | 
-UserId 
		Specifies the ID of a user (as a UserPrincipalName or ObjectId) in Microsoft Entra ID.
Parameter properties
| Type: | System.String | 
| Default value: | None | 
| Supports wildcards: | False | 
| DontShow: | False | 
| Aliases: | ObjectId, UPN, Identity, UserPrincipalName | 
Parameter sets
					GetQuery 
					
				 
				| Position: | Named | 
| Mandatory: | True | 
| Value from pipeline: | True | 
| Value from pipeline by property name: | True | 
| Value from remaining arguments: | False | 
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.