Chaps.
I have pieced something together to update all users in an OU with a picture from a location. I have created a folder on the C:\ADPictures. Lets say I have a user with a SamAccountName of ABC then in C:\ADPictures there would be a ABC.jpg
Now I think I have something wrong with my foreach statement. Can anyone advise? Thanks in advance
foreach ($ADUser in (Get-QADUser -SearchRoot "OU-PATH HERE")) {
$ADPictures = "C:\ADPictures\"
$photo = [byte[]](Get-Content $ADPictures\$ADUser.jpg -Encoding byte)
Set-ADUser $ADUser -Replace @{thumbnailPhoto=$photo}
}