Elsewhere

(The following is based on this VMware KB article which is for ESXi 4.0 and earlier but can be made to work for later versions too).

In vSphere client we can see the VMware Tools related settings of a VM in the Options tab of the VM properties window. In PowerCLI these are exposed under the ExtensionData object. Specifically the ExtensionData.Config.Tools object.

1

2

3

4

5

6

7

8

9

10

11

12

13

PowerCLI>(Get-VMVS-SERVER).ExtensionData.Config.Tools

ToolsVersion:9354

AfterPowerOn:True

AfterResume:True

BeforeGuestStandby:True

BeforeGuestShutdown:True

BeforeGuestReboot:

ToolsUpgradePolicy:upgradeAtPowerCycle

PendingCustomization:

SyncTimeWithHost:False

LastInstallInfo:VMware.Vim.ToolsConfigInfoToolsLastInstallInfo

The ExtensionData object has many methods and properties – think of it like the advanced options menu in a GUI. One of these methods is ReconfigVM() which takes an object of type VMware.Vim.VirtualMachineConfigSpec and reconfigures the VM accordingly.

So to take the example of modifying the VMware Tools update settings all one has to do is create a new object of the type above and pass it to the ReconfigVM() method. Something as below.

First we create an object of this type:

1

$config=New-ObjectVMware.Vim.VirtualMachineConfigSpec

If we look at this object now we will see that it has various properties and methods. The Tools related settings are controlled by a property called Tools of type VMware.Vim.ToolsConfigInfo. To modify these we need to create a new object of that type: