In summary, the script bulk imports photos into AD, by selecting them from a network share based on their age. It will even re-size the photos on the fly according to Microsoft's recommendations, whilst ensuring to keep the original proportions. The cool thing is, that you can launch it from a scheduled task, so all someone has to do is save any new photos to the nominated location and they will get imported automatically.
During the import process the photos get checked against valid users in AD, so they need to be in the format of username.jpg. Everything is logged and if this test fails it will be added to the user friendly email output which can again become someone else's responsibility to receive and action. IT can get CC'd on this of course and step in as necessary.
The syntax to use is as follows
Set-ADPhotos SourcePath Days
For example
.\Set-ADPhotos '\\Server1\sharename' 1
The 'Source Path' can be any local folder or network share that's accessible. The photos are then copied down to a local working path for the actual import. Both the original photo (if one exists) and the new photos are date stamped and backed up. So if you have to restore a photo, you can simply place a copy (as username.jpg), back into the working directory and do a manual run without having to wait for the next schedule.
The 'Days' parameter is used to filter the import of photos based on the modified date. So for example '1' will only import photos modified in the last day. Assuming you run this as a scheduled task, it's important then to match the schedule with the the number of days entered.
Finally, if you're a Lync shop, the script can trigger an update of the Address Book which gets the photos out to the clients pretty quickly.
Here's the full script, or download it from GitHub.
Cheers,
(__)
(oo) ok
/------\/ /
/ | ||
* /\---/\
^^ ^^
This comment has been removed by a blog administrator.
ReplyDeletewould you be willing to work with me on this script? I appreciate the work that you have put in to this project. My Situation is slightly different and I would like to try and leverage the work you put in on this script
ReplyDeleteVince@TVWGroup.net