Advertisement
slippyfox

Untitled

Apr 24th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function StringToHex($i) {
  2.     $r = ""
  3.     $i.ToCharArray() | foreach-object -process {
  4.         $r += '{0:X}' -f [int][char]$_
  5.         }
  6.     return $r
  7.     }
  8. $sshKey = 'ssh pub key here lolz'
  9. $sshPublicKey = StringToHex -i $sshKey
  10. $UsernameAddTo = "TestingAccount"
  11. Set-ADUser $UsernameAddTo -Replace @{sshPublicKey="$sshPublicKey"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement