Forum Discussion
How to list users synced from onprem AD and cloud-only users?
- Apr 29, 2019
Teijo Hämäläinen I would try following Get-MsolUser -All | ?{-not $_.lastdirsynctime}
Teijo Hämäläinen I would try following Get-MsolUser -All | ?{-not $_.lastdirsynctime}
- VasilMichevApr 29, 2019MVP
There's also Get-MsolUser -Synchronized. Using the server-side filtering is faster approach, and also makes sure you don't get a trimmed list because of hitting the limit for number of objects returned (like when you have the Get-AzureADUser cmdlet above, without the -All switch, and filtering client-side).
- Martin RublikApr 30, 2019Brass Contributor
thanks, definitely a better solution.
Martin
- Scorpio69May 04, 2019Copper Contributor
Martin RublikThere is another easier option to use it. Cloud only and on prem users have big difference - Its called Immutable ID
So Get-MsolUser | where-Object {$_.ImmutableId -eq $null} -> for On prem users
Get-MsolUser | where-Object {$_.ImmutableId -ne $null} for Azure AD users ( Cloud users)
- Teijo HämäläinenMay 08, 2019Copper Contributor