Backtrack:  
 
by lunarg on November 5th 2015, at 10:49

The Office365 Admin portal clearly shows which users are synced to AD and which are cloud only. In Powershell, this is less clear. To find out which are cloud-only, you need to check the value of LastDirSyncTime. If it is empty, then the user was never synced from AD, and thus, is a cloud-only user.

Log on to your Office 365 tenant through Powershell, then run:

Get cloud-only users:

Get-MsolUser -All | Where { $_.LastDirSyncTime -eq $null }

Get synchronized-only users:

Get-MsolUser -All | Where { $_.LastDirSyncTime -ne $null }