SimonS
SimonS

Reputation: 1973

ConvertTo-SecureString - use encrypted password for everyone

I stored a pw encrypted in a txt file and load it into a powershell session with:

gc .\localadmincred.txt | convertto-securestring

This doesn't work because i read that only the User that encrypted that key, can convert it to a secure string, everyone als can't decrypt the string that is in my txt.

How can I store an encrypted string in a file so that everyone can use it with convertto-securestring?

Upvotes: 1

Views: 5881

Answers (1)

David
David

Reputation: 621

You can encrypt the string with a key. If another user has the key, he/she will be able to decrypt the string.

See example: Secure Password with PowerShell: Encrypting Credentials – Part 2

Upvotes: 2

Related Questions