One2Many scripts and credentials
As a security best practice, we don’t recommend including plain text passwords or secrets in your One2Many scripts. Instead, you can create encrypted files that are distributed to your host computers, which your One2Many scripts can utilize.
- Create a local encrypted file with the necessary password/secret.
- Distribute the file to the necessary host computer(s) via One2Many.
- Write a script for One2Many to utilize the password/secret that has already been distributed to your host computer(s) in the step above.
Results: This ensures that you are not including plain text passwords in script repositories.
$encStr = Get-Content .\password.txt
$encStr | ConvertFrom-SecureString -Key $key