on-internet
← Community

How to securely store a password for a script run every day using a Windows task scheduler? [closed]

Stack Overflow ·

I have written a PowerShell script to do some operation. When the operation is completed, I want the script to send a mail using the Send-MailMessage cmdlet. For this I used Google's app password feature. But I'm not confident about storing the app password as plain text in the script itself. I can encrypt somehow and store it in the script or separate file, but people can still see that password. Even if I encrypt the password, the decryption login will be there in the script itself. One other way I think would be useful is passing the encrypted password as an environment variable but 1. I co

Comments

Sign in or sign up to comment and upvote.

No comments yet.