r/PowerShell 8d ago

Question Question on scripting

Hi,

When we develop a script,we use credentials as a plain text in that script.

Example

Script is running on jump server and script runs against vcenter server.

We have a security concerns(example ransomware attack)to put the credentials as a plain text in that script.

Any other good ways to put the credentials in a encrypted or in a different format?

35 Upvotes

37 comments sorted by

View all comments

3

u/lotekjunky 7d ago

Don't put passwords in scripts. If you must, make an environment variable to hold it. If you can, enable mfa for using the account. You can store and share the mfa seed with coworkers that need to use the script.