Hello,
This issue occurs because the photo is too large. The maximum size of a user’s photo is 100 kilobytes, and this limitation comes from Active Directory, not from Adaxes. You need to downscale your photos before uploading them to Active Directory using a Business Rule Before updating a user. For details on how to do this, please, check out this script from our repository: https://www.adaxes.com/script-repository/optimize-user-photo-s362.htm.
Also, you need to use the below version of the script to import user photos:
$picturePath = "\\SERVER\Share\%username%.png" # TODO: modify me
# Check whether the picture file exists
if(!(Test-Path -Path $picturePath))
{
$Context.LogMessage("File does not exist '$picturePath'.", "Error")
return
}
# Pipleline bind to the user
$user = $Context.BindToObjectByDNEx("%distinguishedName%", $True)
# Update picture
[Byte[]]$pictureBytes = Get-Content $picturePath -Encoding Byte
$user.Put("thumbnailPhoto", $pictureBytes)
$user.SetInfo()
The reason is that the operation has to be passed through Adaxes pipeline for the Business Rule Before updating a user to trigger.