Uploading Photos Using the Exchange Management Shell

To upload a photo using the Exchange Management Shell, place a copy of the photo in a local subdirectory that is accessible to the Management Shell. The filename of the photo can then be referenced in a variable within the shell and used to apply the photo to the user account. For example, the following series of Exchange Management Shell commands would be used to upload a photo with a filename of dross.jpg to the corresponding user account:

$photostring = "c:\temp\dross.jpg"$pic=([Byte[]] $(Get-Content -Path $photostring -Encoding Byte -ReadCount 0))Set-UserPhoto -Identity dross -PictureData $pic -confirm:$falseSet-UserPhoto -Identity dross -save -confirm:$false ...

Get Microsoft® Lync® Server 2013 Unleashed Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.