Virtualization, Cloud, Infrastructure and all that stuff in-between

My ramblings on the stuff that holds it all together

POSH1Liner Query Azure Active Directory – AAD from PowerShell

You need to install the module (it’s not installed by default) – full cmdlet list is here https://docs.microsoft.com/en-gb/powershell/module/Azuread/?view=azureadps-2.0

this is the new version, seems to use connect-azureAD rather than the connect-MSOLservice you may have used in the past and will work with MFA accounts as it pops a browser window for credentials

Install-Module AzureAD

For example;

Get-AzureADUser

 

will list out all the users synchronised to your AAD, and if you are wondering how to check how many have sync’d from your on-prem AD to AAD you can do

$data = Get-AzureADUser -All $True

Then checking the contents of the $data.count variable will tell you the total number of users in AAD

 

 

 

Leave a comment