Hey all, I’m a MS Teams admin and need some help with removing and adding a photo for end users display pics via PowerShell.
I can remove them and I can add a new photo for everything O365 except Microsoft Teams. Microsoft Teams on the other hand will only remove the display pic but won’t add the new one.
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
Import-PSSession $exchangeSession
Get-UserPhoto -Identity user@domain.com.au
Remove-UserPhoto -Identity user@domain.com.au
Set-UserPhoto -Identity "user@domain.com.au" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\user\desktop\photo.jpg"))
Set-UserPhoto -Identity "user@domain.com.au" -PictureData ([System.IO.File]::ReadAllBytes("C:\Users\user\desktop\photo.jpg")) -Preview
...