Created
July 17, 2019 13:46
-
-
Save justinloring/add5123bf9806251eab0c5e824506029 to your computer and use it in GitHub Desktop.
Create Encryption Key/Credential
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
$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