Forum Discussion
Deleted
May 10, 2018Profile pictures in O365
HI there, I have users with and some without profile pictures in O365 - please assist with a script or tool to extract a list of users "without" profile pictures in O365? Please,please Thank...
Deleted
May 10, 2018HI Daniel,
Another one - how do I add filter to output - DisplayName, UserPrincipalName, Department, LastLogonTime and haspicture -eq $false
Thanks
Daniel Laskewitz
May 10, 2018Iron Contributor
You can add properties to the select:
$allUsers = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | select UserPrincipalName, Alias, DisplayName, Department, LastLogonTime
For the haspicture -eq $false you can add the else part of the if/else statement:
If($photo.PictureData -ne $null) {
[io.file]::WriteAllBytes($path,$photo.PictureData)
Write-Host $user.Alias “profile picture downloaded”
}
Else {
# Insert your logic here
}- DeletedMay 10, 2018
Thank you, Sir!