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...
Daniel Laskewitz
May 10, 2018Iron Contributor
Hi Deleted,
Take a look at this link: https://www.jijitechnologies.com/blogs/how-to-download-office365-user-profile-photo. With a little modification (adding an else-statement) you will be able to get all people who don't have a user profile picture.
Kind regards,
Daniel
- DeletedMay 10, 2018
HI Daniel,
Another one - how do I add filter to output - DisplayName, UserPrincipalName, Department, LastLogonTime and haspicture -eq $false
Thanks
- Daniel LaskewitzMay 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!