SOLVED
Home

How to get the manager with the get-user?

%3CLINGO-SUB%20id%3D%22lingo-sub-151730%22%20slang%3D%22en-US%22%3EHow%20to%20get%20the%20manager%20with%20the%20get-user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-151730%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20added%20managers%20to%20a%20handful%20of%20employees%20with%20the%20command%20line%20for%20the%20purpose%20of%20testing%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ESet-User%20andy.kw%20-Manager%20Big.Boss%3C%2FPRE%3E%0A%3CP%3EI%20can%20see%20the%20manager%20through%20the%20graphical%20interface%20of%20Office%20365%20but%20when%20using%20the%20%3CSTRONG%3Eget-user%3C%2FSTRONG%3E%20cmdlet%2C%20nothing%20is%20coming.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20looking%20at%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Faa996896%2528v%3Dexchg.160%2529.aspx%3Ff%3D255%26amp%3BMSPPError%3D-2147217396%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Edoc%3C%2FA%3E%2C%20nothing%20is%20mentioned%20though.%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20ideas%3F%3CBR%20%2F%3E%3CBR%20%2F%3ECheers%2C%3C%2FP%3E%0A%3CP%3EAndy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-151730%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECmdlets%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-151943%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20manager%20with%20the%20get-user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-151943%22%20slang%3D%22en-US%22%3E%3CP%3EGet-User%20should%20also%20reflect%20on%20the%20changes%20though.%20It%20might%20be%20some%20delay%20replication%2C%20but%20that%20shouldn't%20take%20more%20than%20a%20couple%20of%20minutes.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-151745%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20manager%20with%20the%20get-user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-151745%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20you%20should%20install%20Azure%20AD%20module%20for%20Powershell%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fazure%2Factive-directory%2Finstall-msonlinev1%3Fview%3Dazureadps-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fazure%2Factive-directory%2Finstall-msonlinev1%3Fview%3Dazureadps-1.0%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(please%20mark%20my%20reply%20as%20accepted%20response%20if%20it%20helped)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-151740%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20manager%20with%20the%20get-user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-151740%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20P.R%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20the%20quick%20reply.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%26nbsp%3B%3CSPAN%3ESet-%3CSTRONG%3EAzureADUserManager%3C%2FSTRONG%3E%20is%20only%20available%20the%20azure%20ad%2C%20right%3F%3CBR%20%2F%3E%3CBR%20%2F%3ECheers%2C%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAndy%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-151735%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20get%20the%20manager%20with%20the%20get-user%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-151735%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20should%20connect%20to%20Azure%20AD%20and%20run%20Get-AzureADUserManager%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fget-azureadusermanager%3Fview%3Dazureadps-2.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fget-azureadusermanager%3Fview%3Dazureadps-2.0%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EAnd%20for%20adding%20manager%20to%20Office%20365%20users%20you%20can%20use%20Set-AzureADUserManager%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Andy Kw
Occasional Contributor

Hi,

I've added managers to a handful of employees with the command line for the purpose of testing

 

Set-User andy.kw -Manager Big.Boss

I can see the manager through the graphical interface of Office 365 but when using the get-user cmdlet, nothing is coming.

 

When looking at the doc, nothing is mentioned though.

Any ideas?

Cheers,

Andy

4 Replies

You should connect to Azure AD and run Get-AzureADUserManager

https://docs.microsoft.com/en-us/powershell/module/azuread/get-azureadusermanager?view=azureadps-2.0

And for adding manager to Office 365 users you can use Set-AzureADUserManager

Hi P.R,

 

Thanks for the quick reply.

The Set-AzureADUserManager is only available the azure ad, right?

Cheers,

Andy

 

 

Solution

Yes, you should install Azure AD module for Powershell:

https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-msonlinev1?view=azureadps...

 

(please mark my reply as accepted response if it helped)

Get-User should also reflect on the changes though. It might be some delay replication, but that shouldn't take more than a couple of minutes.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies