Forum Discussion
Teijo Hämäläinen
Apr 29, 2019Copper Contributor
How to list users synced from onprem AD and cloud-only users?
Hello guys! I was tasked to list users synced from onprem AD and cloud only users I have downloaded and imported AzureAD PS module 2.0.2.16 Azure portal shows several users with source 'A...
- Apr 29, 2019
Teijo Hämäläinen I would try following Get-MsolUser -All | ?{-not $_.lastdirsynctime}
ved-leachim
Apr 05, 2022Brass Contributor
I would recommend using the AzureAD PowerShell Module. You can use the following command to get a list of all Cloud Only Accounts:
Get-AzureADUser -All $true | Where-Object {$_.ImmutableId -eq $null}
If you want a list with the Cloud Only Accounts without guests, you could use the following command:
Get-AzureADUser -All $true | Where-Object {$_.ImmutableId -eq $null -and $_.UserPrincipalName -notlike "*#EXT#*"}