The script exports a user's photo stored in the Picture (thumbnailPhoto) attribute to a file.
To export photos using Adaxes, you can create a custom command that runs the script. For more information, see Create a Custom Command.
Parameters:
- $filePath - specifies a template for the file path that will contain the user's photo. You can use value references (e.g. %username%) to insert properties of the user account as a part of the path.
PowerShell
$filePath = "\\Server\share\UserPictures\%username%.jpg" # TODO: modify me
try
{
$thumbnailPhoto = $Context.TargetObject.Get("thumbnailPhoto")
}
catch
{
return # The Picture property is empty
}
try
{
Set-Content -Path $filePath -Encoding byte -Value $thumbnailPhoto -ErrorAction Stop
}
catch
{
$Context.LogMessage($_.Exception.Message, "Error")
}
No, the script gets the photo from the Picture (LDAP name thumbnailPhoto) property of an on-premises AD account.