Avatar of jhyiesla
Flag for United States of America asked on

PowerShell for Office 365 and Azure AD

Personally, I think that PowerShell should be called PowerSh**.

There's regular PS and then there's the Azure one and then there's the Exchange management shell that is sort of another PS and who knows, there may be more.


So, I've worked my way thru this once before, but have now come up empty in remembering what I did.  I've spent about an hour or so perusing the Internet looking for the commands that have to go in front of the commands that I want to do.  And, of course there doesn't appear to be a single article that outlines exactly the commands. And even when I trace the supposed commands that go before the ones that I need, I usually end up with an error that the command I've just executed isn't a valid command.

So, here are the two commands that I want to ultimately execute:

Get-MSOLUser –UserPrincipalName <UPN of the affected user> | FL | Clip
Get-Mailbox –Identity “User Name” | FL | Clip

I'm trying to track down an issue between on -premise AD and Office 365.

Can you tell me which PS  or PS's I really want to run for these and what commands have to come first in order for these to be recognized?  I'm running these either on a Windows 2012 server or  Windows 10 PC.
PowershellMicrosoft OfficeMicrosoft 365

Avatar of undefined
Last Comment
Jeremy Weisinger

8/22/2022 - Mon
Jeremy Weisinger

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

Perfect, thanx... what it I want to run them against the Azure AD side, or is that even a thing?
Jeremy Weisinger

MSOL commands only apply to Azure AD. :)

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
David Johnson, CD

Powershell is infinitely extensible by the use of modules.  If the modules are in your psmodulepath then since powershell 4 they will automatically import.  If you don't like using Powershell to manage things and don't like scripting you are always free to NOT use it and use the gui tools. Scripting gives you repeat-ability.
Jeremy Weisinger

Glad to help. :)