Export thumbnailphoto from AD to jpg for all users

For exporting users thumbnail photo from AD to jpg for all users you can use script below:

Get-ADUser -Filter * -Properties thumbnailphoto | 
where {$_.thumbnailphoto} | foreach {$_.thumbnailphoto | 
Set-Content -Path "C:$($_.UserPrincipalName).jpg" -Encoding Byte}

~Pouyan

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.