Saturday, 20 November 2010

Windows PowerShell - Save and Reuse Credentials

The following script saves credentials for the servers listed in the CSV file.

Script:

clip_image001

CSV File (The SecureString property is created when the above script is run):

clip_image002

The following script uses the stored credentials to monitor the servers stored in the CSV file:

The script below uses the IP Address, but the Hostname could be used instead if DNS were configured properly.

clip_image003

The output:

clip_image004

No comments:

Post a Comment