0

I store my connection-string in XML file. Then i use it in powershell script. Is there a way to secure it/to encrypt it somehow?

0

1 Answer 1

2

There are two methods I've seen for encrypting in Powershell

Use *SecureString cmdlets. It should be noted only the Windows ID that encrypted the original string can decrypt it (since it uses the Windows login as key)

Use a pass phrase with the Library-StringCrypto functions

Because of the limitations of the first method, I use the second. I'll then store my encrypted connection string in a SQL table and lock down permissions. To make a connection I'll retrieve the connection string from the SQL table and decrypt using a pass phrase.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you. i very like the idea of storing connection string in sql table. but my supervisor doesnt like it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.