Azure AD Mailbag : PowerShell Tips and Tricks!
Published Sep 06 2018 08:52 PM 1,236 Views

First published on CloudBlogs on Mar, 04 2016

Howdy folks!


Happy Friday to all of you! Just got back from an awesome RSA Conference. Thanks to all of you who stopped by our booth to chat! Today Mark and team have whipped up an Azure AD Mailbag that answers some of the most frequent PowerShell questions Azure AD Admins have.


Have a great weekend,

Alex Simons

(Twitter: @Alex_A_Simons)

Director of Program Management Microsoft Identity Products and Services




Hey y'all,


Mark Morowczynski here with our Friday mailbag. It's been an exciting week and we thought we'd cap it off with some more quick PowerShell tips and tricks. We've also added GraphAPI as well. If you haven't started to learn that yet you really should. As always if there are topics and areas you'd like us to cover let us know on Twitter at @AzureAD , @MarkMorow and @Alex_A_Simons . On to the questions.


Question: In your PowerShell tips and trick post ( ) you showed how to find "Guest" user in the directory using PowerShell. Can I do this via the GraphAPI?

Answer: Yes! You'll want to change the userType attribute to "Guest" see more at


Question: Is there a way in PowerShell to get the GUID of my Azure AD Tenant?

Answer: You'll want to use the Get-MSOLCompanyInformation | select objectID. For more info


Question: Is there a way in the GraphAPI to see what users and groups are assigned to a specific application?

Answer: Yes you'll want to check out the AppRoleAssignment entity.


Question: Is there a way via PowerShell to get a report of what users have Azure AD Premium or EMS licenses assigned?

Answer: Yes. It's all inside Get-MsolUser. This should help. Get-MsolUser -All | where {$_.isLicensed -eq $True} | Select-Object -Property UserPrincipalName -ExpandProperty Licenses | ft UserPrincipalName,AccountSKUId


Question: I've recently attended one of the Azure AD Webinars on MFA and the speaker talked about turning on MFA for administrative accounts. How can I require my Global Admins to require MFA and still use PowerShell to do administration?

Answer: Yep, you'll want to try the latest version of PowerShell we talked about at To see all release history, see


We hope you've found this post and this series to be helpful. For any questions you can reach us at, the Microsoft Forums and on Twitter @AzureAD , @MarkMorow and @Alex_A_Simons


-Mark Morowczynski and Shane Oatman

Version history
Last update:
‎Jul 24 2020 02:06 AM
Updated by: