Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save justinloring/add5123bf9806251eab0c5e824506029 to your computer and use it in GitHub Desktop.
Save justinloring/add5123bf9806251eab0c5e824506029 to your computer and use it in GitHub Desktop.
Create Encryption Key/Credential
$Key = New-Object Byte[] 32
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key)
$Key | out-file '\\srilcredev01\c$\RSICode\StoredCreds\aes.key'
$credential = Get-Credential
$credential.Password | ConvertFrom-SecureString -key (get-content '\\srilcredev01\c$\RSICode\StoredCreds\aes.key') | Set-Content '\\srilcredev01\c$\RSICode\StoredCreds\LogOnAsBatch.txt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment