Notice: Due to size constraints and loading performance considerations, scripts referenced in blog posts are not attached directly. To request access, please complete the following form: Script Request Form Note: A Google account is required to access the form.
Disclaimer: I do not accept responsibility for any issues arising from scripts being run without adequate understanding. It is the user's responsibility to review and assess any code before execution. More information

Update Thumbnail Photo in ADDS

 If you have the requirement to update a thumbnail photo in AD or Active Directory then you cannot natively upload using the MMC however what you can do is use these commands:

$ADphoto = [byte[]](Get-Content <path to file> -Encoding byte)
Set-ADUser<username> -Replace @{thumbnailPhoto=$ADphoto}

This is an example of an actual user for the point of this blog:

$ADphoto = [byte[]](Get-Content "c:\temp\imgage.PNG" -Encoding byte)
Set-ADUser photo.bear@bear.local -Replace @{thumbnailPhoto=$ADphoto}

The attribute will look like this: 



The attribute value should go from this:



To this, if you notice this attribute is empty then the command as not run correctly, also remember to wait for ADDS replication...


The command above uploads the bytes to AD under the attribute thumbnailPhoto which is a hexadecimal attribute, you will notice that if you have "show only attributes that have values" selected this will not be visible until you actually have a photo in ADDS.





Previous Post Next Post

نموذج الاتصال