Last active
August 29, 2015 14:02
-
-
Save nonprofittechy/1f8123f79166241575fa to your computer and use it in GitHub Desktop.
Bulk-Import photos into AD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ipath = "C:\PATH_TO_THUMBNAILS" | |
$images = gci -Path $ipath | |
$jpgBytes = $null | |
foreach ($image in $images) { | |
$jpgBytes = $null | |
$jpgBytes = [byte[]]$jpg = Get-Content ($image.fullName) -encoding byte | |
set-aduser -id $image.BaseName -replace @{thumbnailPhoto = $jpgBytes} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment