How to retrieve the properties and relationships of an administrative unit using Microsoft Graph PowerShell

Retrieving an administrative unit's (AU) properties and relationships offers crucial insights into its structure and function. Microsoft Graph PowerShell helps you do this using the Get-MgDirectoryAdministrativeUnit cmdlet. By understanding AU connections, administrators can effectively delegate responsibilities and enforce security policies.

Retrieving an AU's properties using Microsoft Graph PowerShell

Prerequisites

Before using the Get-MgDirectoryAdministrativeUnit cmdlet, ensure the following:

  • If the Microsoft Graph PowerShell module is not installed, install using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the following permission retrieve an AU's relationship and its properties:
    AdministrativeUnit.Read.All

Using the Get-MgDirectoryAdministrativeUnit cmdlet

Run the following commands in Microsoft Graph PowerShell to retrieve an AU's relationship and its properties:

Get-MgDirectoryAdministrativeUnit
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-Filter <String>]
[-Search <String>]
[-Skip <Int32>]
[-Sort <String[]>]
[-Top <Int32>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PageSize <Int32>]
[-All]
[-CountVariable <String>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]

Supported parameters

The following table contains some parameters that can be used along with the Get-MgDirectoryAdministrativeUnit cmdlet.

Parameters Description
-All Lists all pages.
-CountVariable Specifies a count of the total number of items in a collection.
-ExpandProperty Expands the related entities.
-Filter Filters items by property values.
-Headers Provides optional headers that will be added to the request.

Limitations of using Microsoft Graph PowerShell to retrieve AU properties

  • PowerShell scripts can get complicated with different use cases and scenarios.
  • IT admins can spend a lot of time debugging errors, which in turn negatively impacts productivity.
  • Delegation can get tricky since technicians require elevated permissions.

Highlights of ADManager Plus

Say goodbye to complicated PowerShell scripts with ADManager Plus, an identity governance and administration solution. ADManager Plus' comprehensive Microsoft Entra ID management and reporting simplifies complex admin tasks from a single, user-friendly console:

  • Manage users, contacts, groups, licences, and other Microsoft Entra ID objects with a script-free, centralized console.
  • Reduce human errors by automating and orchestrating tasks such as user provisioning, deprovisioning, and license assignment across various platforms.
  • Delegate tasks to technicians without elevating their native privileges.
  • Keep a watchful eye on your IT environment with more than 200 prepackaged reports.
  • Monitor delegated activities through smart workflows.
  • Ensure business continuity with AD, Microsoft Entra ID, and Google Workspace backup and recovery.

Perform script-free Microsoft Entra ID management and reporting with ADManager Plus

 
  • Retrieving an AU's properties using Microsoft Graph PowerShell
  • Limitations of using Microsoft Graph PowerShell to retrieve AU properties
  • Highlights of ADManager Plus
The one-stop solution to Active Directory Management and Reporting
Email Download Link