We are currently in a hybrid Exchange/365 environment. We need to find out who doesn't have photos attached to their accounts. Unfortunately the scripts I'm using are indicating people don't have photos that do in fact have them, so I'm not getting anywhere.
First I tried this script against my local AD:
get-aduser -searchbase 'OU=Users,DC=mydomain,DC=local' -Filter {(Enabled -eq $true)} | Where {$_.thumbnailPhoto -eq $NULL}
This output every user in the OU. Picking a user I knew had a photo (like myself) I exported all of the attributes of the user and there was no thumbnailPhoto attribute. There was however a jpegPhoto attribute, but changing the query to look for jpegPhoto -eq $NULL returned no results at all.
So then I found a script to run against Exchange Online. I connected to it via Powershell and ran the following:
get-mailbox -resultsize Unlimited -RecipientTypeDetails Usermailbox | Where {$_.HasPicture -eq $false} | Select-Object DisplayName,UserPrincipalName,HasPicture
Again, this output everybody, including myself (who definitely has a picture).
What am I missing here?