NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

encrypting password for accessing the array

DJRIVERA01
3,277 Views

Hi,

Is there a way to do this so we don't have to leave plain text password around?

1 REPLY 1

billyd
3,277 Views

Yes, try this. 

read-host -assecurestring | convertfrom-securestring | out-file C:\securestring.txt`

Once you have the encrypted password file created, you can add the following to your script or run direct from the CLI:

$username = "domain01\user"
$password = cat C:\securestring.txt | convertto-securestring
$cred = new-object -typename System.Management.Automation.PSCredential `
         -argumentlist $username, $password

Then, connect-nacontroller controller01 -Credential $cred

Public