The Get-MgContactManager cmdlet is used in Microsoft Graph PowerShell to retrieve the manager details assigned to a specific organizational contact in Microsoft Entra ID. IT administrators can leverage this command to track reporting hierarchies and ensure accurate contact management.
Before using the Get-MgContactManager cmdlet, ensure the following:
Install-Module Microsoft.Graph -Scope CurrentUser
Here's how you can use the Get-MgContactManager cmdlet to fetch the manager of a Microsoft Entra ID contact:
Get-MgContactManager
-OrgContactId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]
Example 1: Retrieving the manager of a specific contact
Get-MgContactManager -OrgContactId 2763276-hb56-adas-3477-565868bcfyyf
Example 2: Fetch manager details of multiple Microsoft Entra ID contacts
$contacts = Get-MgContact | Select-Object Id
foreach ($contact in $contacts) {
Get-MgContactManager -OrgContactId $contact.Id
}
| Parameters | Description |
|---|---|
| -ExpandProperty | This parameter expands the Manager property, fetching detailed attributes like name, email, and job title. |
| -OrgContactId | This parameter allows you to specify the unique identifier of an organizational contact whose details you would like to fetch. |
While Graph PowerShell enables administrators to retrieve the details of organizational objects, relying on it for reporting and management can be cumbersome due to its command-line interface and scripting requirements. ADManager Plus overcomes these challenges by offering a user-friendly, script-free interface for Microsoft 365 management and reporting. With predefined, customizable, and schedulable reports, ADManager Plus simplifies complex hybrid AD management and reporting, reducing dependency on manual scripting.