Tuesday 20 June 2017

Update your photo with powershell for windows Outlook/Lync/Skype-for-business/etc


NOTE: See my following post which does not required the Remote Server Administration Tools to be installed.

Thanks to the EZ IT guy who writes explaining that by installing the Remote Server Administration Tools for Windows 10 (or Windows 7 if you need it) you can then read your windows domain thumbnail photo picture.jpg like this:

$record = Get-ADUser $ENV:USERNAME -Properties thumbnailPhoto
$record.thumbnailPhoto | Set-Content "picture.jpg" -Encoding byte

And, provided that your photo is less that 100K you can also upload it:

Set-ADUser $ENV:USERNAME -Replace @{thumbnailPhoto=([byte[]](Get-Content "picture.jpg" -Encoding byte))}

All this requires that you be logged into your domain. Also thanks to the WOSHUB for help simplifying it.

If only there were a way that didn't require installing Remote Server Administration Tools.

Also some talk here from heyscriptingguy.

No comments:

Post a Comment