Monday, 14 May 2012

VM Report- PowerCLI Script

VM Report- PowerCLI Script

This is a pretty straight forward script written in PowerCLI..

This script will generate an Excel sheet with some VM information in it... For E.G. it will color the cell red if the Power State of a VM equals to NotRunning... or if the version of VMware Tools installed in it are old/ outdated..


NOTE: To run the script, simply copy the contents from the PDF and paste it in a new file with the extension as ".ps1"

To run the script:

  1. You will require PowerCLI to be installed on your local machine

  2. Administrative rights to run the script as well as administrative rights to your vCenter Server

Steps to run the script:

  1. start your PowerCLI command line tool

  2. go the the directory where you have saved the script (In this case, i have saved it in D:/scripts folder)

  3. run the script

  4. when the script executes, it will ask you to enter your vCenter IP (In this case, its

  5. provide the IP and hit enter key.

  1. it will prompt you to enter your vCenter credentials. Provide your Administrative credentials.

  1. once you provide your correct credentials, the script will start execution.

  2. it will display a Excel sheet with a Header row and some data in the beginning. Eventually it will be populated as the script gathers more info from your vCenter. a Demo Output image is shown below:

No comments :

Post a Comment

Note: only a member of this blog may post a comment.