Advertisement
Guest User

Untitled

a guest
Jul 12th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $user = 'FIRST_LAST'
  2. $username = 'USER'
  3. $photoName = Get-ChildItem -Path \\PATH -Recurse -Include $user*_bw_crop.jpg -File | Select-Object -ExpandProperty Name
  4. $photo = Get-ChildItem -Path \\PATH -Recurse -Include $user*_bw_crop.jpg -File
  5. $photocopy = $photo | Copy-Item -Destination "C:\temp"
  6.  
  7.  
  8. Set-UserPhoto -Identity $username -PictureData ([System.IO.File]::ReadAllBytes("C:\temp\$photoName")) -Confirm:$False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement