Did you know that VMware stores a lot of information about your virtual machines? And that you can retrieve all that data with PowerCLI?

When you retrieve an object from vCenter or your ESXi host you get a lot of information. When you use Get-VM the object returned contains  multiple properties. Each property can have a single value or multiple values. Taking a look into the virtual machine object, you see a property called ExtensionData. That property contains. Each VM object has a lot of information stored with it in the ExtensionData property.

Try the next cmdlet, replace Photon with a machine in your environment:

or in one line:

or even shorter:

You get sometime like this, depending on your virtual machine:

The items that start with VMware.Vim are properties described in the vSphere API reference documentation.

Getting information

For example: If you want to know if  VMware tools are running for a particular machine, Photon in this case, you can use the the following command:

The reply would be in my case ‘guestToolsRunning’.

Or if you want to know what the uptime is for your VM you could just check ExtensionData:



Now you

What are you doing with ExtensionData?