VMware Cloud Community
stratolynne
Contributor
Contributor

Can the password be encrypted?

Recently upgraded to ESXi 4.1.  Now want to start working with PowerCLI.

First question I need answered:  password for ESX hosts needs to be encrypted.  Is that possible?  Otherwise,  I don't think I can use PowerCLI.

Thanks!

0 Kudos
2 Replies
rajvm256
Enthusiast
Enthusiast

Yes .. an interesting question .. see an earlier thread..

http://communities.vmware.com/thread/297748?start=15&tstart=0

What about having a user that has only specific access and then do it.

Thanks | http://virtualvm.info/
0 Kudos
mattboren
Expert
Expert

Hello, stratolynne-

It seems as though you are talking about credentials within a PowerShell / PowerCLI script, correct?  The thread that rajvm256 referenced was about OSCustomizationSpecs and their credentials -- a bit different.

If you are talking about the credentials within a script, you can use the handy functions that Hal Rottenberg wrote, Export-PSCredential / Import-PSCredential.  With these functions, as the names indicate, you can export and import credentials.  Read the comments in the code at that page for more info, but basically, the export function encrypts the given credentials in an XML file, and the import function imports the credentials back into a PowerShell session.


The imported credentials can then be used for things like Connect-VIServer, Invoke-VMScript, etc.  LucD gave a link in another thread to a decent usage post by RvdNieuwendijk for the export/import functions.

How do those treat you?

Message was edited by mattboren:  updated usage link; thx to AllenCrawford for the assist

0 Kudos