Powershell API for VCenter

VMware has an interface for VCenter using Powershell that is named PowerCLI.

Network Access:
The Powershell cmdlets for VMware are talking to the web services API running on the VCenter. So if you have network access from the computer to run the VMware vShpere Client, then you should be able to also use the Powershell cmdlets.

Once you have downloaded and installed PowerCLI, to initiate the environment, run the following commands with an account that has access to VCenter (Connect-Server does allow specifying the username/password for a service account)):

Once the environment is setup, all of the cmdlets are loaded and help is available. To view a list of all of the cmdlets, use the following command:

There are additional help docs available at (and online from the link at the top):
C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\VICore Documentation\

To get an array of all VM’s (that the account running the command has permissions to):

Once you have that you do things like retrieve the last performance statistic average for each VM and send it to Out-Gridview (which allows you to sort and filter).  This allows you to answer questions like “Which VM’s are using the most CPU?” or “Which VM’s have the longest uptime (VM, not OS)?” or “Which VM’s have the highest Disk I/O?”:

Or if you just want a report of all of the VM’s:

If you want to upgrade the VMware Tools on a batch of machines (in this example, all Engineering License servers named engr-lic-%) without rebooting them, then entire script would be: