Forum Discussion
How can i get a staff members Director from Azure AD
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
2 Replies
- OllieBrass Contributor
Hi,
How can I get a staff members Director from Azure AD?
Some staff's manager, will be their director, for some it will be their managers, manager, i.e 2 levels up.
For others it may be 3 or 4 levels up dependant where they sit on the organisational structure.
The Director AD accounts are marked with the Description field populated with the word "Director".
What would be the easiest way of doing this?
Thank you for your time,
OllieYou 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