Okay I need help scripting the following. First the script needs to query AD to find AD accounts in one OU that do not have pictures, retrieving their employeeNumber. Then the script needs to match the employeeNumber to a picture on a network share. Finally the script needs to upload the picture.
A couple of things to think about.
1. employeeNumber are base on 9 numbers total with 4 or 5 zeros then numbers example 000012345 or 000001234
2. The pictures are saved without the leading zeros and have a dash with a letter behind. example 12345-a.jpeg, 12345-b.jpeg. We want to select the -b.jpeg picture.
I have the script to find AD accounts that are missing the picture. I'm need help and guidance for the rest.
Get-ADUser -Filter * -Properties thumbnailPhoto | Where-Object {$_.thumbnailPhoto -eq $Null} | FT employeeNumber