Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function StringToHex($i) {
- $r = ""
- $i.ToCharArray() | foreach-object -process {
- $r += '{0:X}' -f [int][char]$_
- }
- return $r
- }
- $sshKey = 'ssh pub key here lolz'
- $sshPublicKey = StringToHex -i $sshKey
- $UsernameAddTo = "TestingAccount"
- Set-ADUser $UsernameAddTo -Replace @{sshPublicKey="$sshPublicKey"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement