Where Did I Put My Tools? Are They In Sync? – Checking the VMware Tools with PowerShell

It’s 7PM, do you know where your VMware Tools are? Rather, do you know if all your VM’s have them installed and running?

Here is a one-liner to check that with PowerShell:

get-vm | where { $_.PowerState -eq "PoweredOn" } | Get-VMGuest | where { $_.State -ne "Running" } | select vmName, State

What this does, is get a list of VM’s, selects those that are running, and then gets the tools status and selects those that do not have a status of “Running”. Easy… no?

Here’s another one-liner to check to see if you have the tools configured to sync time with the host system:

get-vm |where { ( %{ get-view $_.Id } | where { $_.Config.Tools.SyncTimeWithHost -ne "True" } ) } | select name

This one, gets a list of VM’s, then takes from that list, the VM’s that do not have tools set to sync with the host system. There is a lot of { and ( action there… because that info is pretty well hidden.

What else do you check for on your VM’s… tools versions? etc? Leave me a note in the comments.

  • Gurjit Dhillon
    Hi,

    Can you tell me how can I find out the poweroff Vm and also when it is poweroff and by whom with powershell script.

    I know how to get the poweroff vm, but not able to get the other details.

    If possible can you put your comments on this.

    Regards
    Gurjit Dhillon
  • Gurjit,

    Please see the following post (generated based on this comment):
    http://professionalvmware.com/2009/10/a-quick-p...

    Let me know if you have any questions.
blog comments powered by Disqus