Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have started to play around with PowerCLI and therefore created a credentials file to use when I connect to vCenter. The purpose for this will be to run scheduled tasks, such as running the vCheck daily script. I will probably setup a service account for this, that will be a vCenter sever local admin, so I am concerned about the password being in this file.

If you just view the file the password looks encrypted:


After you associate the credentials with a variable ($creds) you can then just view the variable and see the password:

$creds | fl *

Host : test User : test Password : really showing your password here File : your creds file

Is there a way to encrypt this whole file and/or stop this password from being viewed?

share|improve this question
up vote 1 down vote accepted

No there is no (easy) way to stop the password from being viewed but that's not as bad as it looks. The decryption only works under the following circumstances:

  1. The encrypted file must be opened by the same user which created it.

  2. The encrypted file must be opened on the same computer on which it was created.

As long as you're using a strong password for the user account which need to read the credentials it should be save to use the credential file.

I'm using the credential files for many scheduled tasks (non-interacive shell). The shell is automatically closed after the scheduled tasks is finished and the $cred variable is deleted.

In interactive shells I dont use the credential files because I'm able to specify username and password manually.

Hope this helps. Have a nice day.



share|improve this answer
Thanks for the response. This will probably be the answer but I just want to see if anyone else chimes in. – Chadddada May 20 '11 at 13:43

Grub gave a great answer. I would like to add that instead of creating a local admin account, create a normal domain account and then give this user only the specific, Read-only user, permissions it needs from within vCenter. This way, if the account does get compromised, only minimal damage can be done.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.