Forum Discussion

Ollie's avatar
Ollie
Brass Contributor
Feb 26, 2025
Solved

How can i get a staff members Director from Azure AD

undefined
  • VasilMichev's avatar
    VasilMichev
    Feb 26, 2025

    You can get the whole "chain" via this:

    Get-MgUser -UserId email address removed for privacy reasons -ExpandProperty "manager(`$levels=max;`$select=id,displayName,Description)" | select -ExpandProperty Manager

    Then, filter the one with Director title I suppose? There is no "description" field in Entra ID for user objects, you likely have to use the Title one, or something else.

    Here's the documentation on the manager relationship: https://learn.microsoft.com/en-us/graph/api/user-list-manager?view=graph-rest-beta&tabs=http 

Resources