How to export thumbnailphoto from active directory powershell

Опубликовано: 27 Июль 2026
на канале: It System
4,187
20

How to export thumbnailphoto from active directory powershell

All the images of the users in the active directory will be exported with the following PowerShell command in this video.

Powershell command

$list=GET-ADuser –filter * -properties thumbnailphoto
Foreach ($User in $list)
{
$Directory='C:\Photos\'
If ($User.thumbnailphoto)
  {
  $Filename=$Directory+$User.samaccountname+'.jpg'
  [System.Io.File]::WriteAllBytes($Filename, $User.Thumbnailphoto)
  }
}