This is the short script that I created to upload pictures into Exchange 2013.
I places all my files to E:\Photos folder. After that I created file called Photo.ps1.
Open the file and paste the following:
Remove-UserPhoto $UserName -Confirm:$False
$DefaultPhotoPath = “E:\Photos\”
$PhotoPath = $DefaultPhotoPath + $UserName + “.jpg”
$photo = ([Byte] $(Get-Content -Path $PhotoPath -Encoding Byte -ReadCount 0))
Set-UserPhoto -Identity $UserName -PictureData $photo -Confirm:$False
Set-UserPhoto -Identity $UserName -Save -Confirm:$False
When you want to upload picture to the Exchange, copy the picture to folder E:\Photos. The picture should have the same name as AD account is. For example, if you want to add picture to account johnd, the picture should be called johnd.jpg.
Open PowerShell and browse to the directory where you placed Photo.ps1 file and run the following command (for the user johnd):
Congratulations. The picture is uploaded.
You can check it using IE or any other browser: https://mail.domain.local/ews/Exchange.asmx/s/GetUserPhotoemail@example.com&size=HR648x648Follow @ikravchenko