Exchange 2013 User Picture Management
The dreaded ticket: a user's photo had been updated in Active Directory, but the photo in Exchange has not updated. Interestingly enough, this was in a hybrid Exchange 2013 environment. Users located in Exchange Online could see the new photo, but users still located in Exchange on-premises could not (so it would seem the new picture "synced" out to Exchange Online just fine with the user directory synchronization to Office 365).
If you didn't know it, the Exchange 2013 Mailbox Server stores the photo of users homed on that server. These pictures are located in C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\photos\<DomainName>-<GUID>. There are two folders found in here, one for storing pictures sized 96x96 and 648x648.
Note: For the purposes of this blog, the same photo was used for the old/new photo.
At first I tried to just delete the photos here for the user and update the offline address book (Get-OfflineAddressBook | Update-OfflineAddressBook). To my surprise, the old picture returned!
Next, I verified the picture associated to the Active Directory user account was indeed the correct one. You can save the photo from the user's account stored in the thumbnailPhoto property using the following PowerShell command:
Upon opening the picture, I see that the picture was indeed the new picture. Let's do the same for the mailbox inside of Exchange, saving the picture with the following PowerShell code (ran from Exchange Management Shell):
You can also verify the picture stored in Exchange using your webmail URL:
https://<EWS URL>/ews/Exchange.asmx/s/GetUserPhoto?email=<USER EMAIL>&size=HR96x96
And as expected, it was the old picture. Since I had saved the new picture directly from the AD user account, there are Exchange commands to remove a user's current photo and update it with a new one:
Optional step, verify the PictureData property from Get-UserPhoto is now empty:
Now run Set-UserPhoto specifying the path to the AD photo saved from before:
Upon updating the picture manually, it now appeared correctly for the Exchange on-premises users. I still found it interesting that for people in Exchange Online, the photo was updated. I never found a good explanation why the photo in on-premises Exchange had not updated.