$userName = 'mmilic'
$photoPath = 'mmilic.png'
# Set photo
$photo = [byte[]](Get-Content $photoPath -Encoding byte)
Set-ADUser $userName -Replace @{ Photo = $photo }
# Get photo
$user = Get-ADUser $userName -Properties photo
$user.photo.Value | Set-Content -Path $userName.png -Encoding Byte -Force
Created
November 25, 2020 09:38
-
-
Save bryceprutsos/90485c7fc6698918c27882beee44944b to your computer and use it in GitHub Desktop.
AD photo #ad #windows
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment