Forum Discussion
Assigning a Manager with PowerShell Graph – Manager Not Found
Hi everyone,
We are currently refactoring our PowerShell scripts to align with Microsoft's recommended standards. In our script that creates new users in Azure Active Directory (AAD) via Microsoft Graph, we’re having trouble assigning a manager to a new user.
Whether we try using the manager’s object ID or email address, the manager is not found, and the assignment fails.
Has anyone encountered this issue before? Is there something we might be doing wrong in how we’re referencing or assigning the manager?
Thanks in advance for your help.
3 Replies
- U375700Copper Contributor
- Andres-BohrenSteel Contributor
Hi U375700
The Output shows that the command is unknown.
Have a look at this one: Set-MgUserManagerByRef
https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.users/set-mgusermanagerbyref?view=graph-powershell-1.0
Kind Regards
Andres- U375700Copper Contributor
Thanks for your feedback, unfortunately Microsoft's hints didn't work. The one that solved the problem for me was the script below:
Assign Managers for Microsoft 365 Users Using Graph PowerShell
To update or assign a manager for users in Microsoft 365, administrators can use the cmdlet
Thanks for the help.
Best regards.