VMware Cloud Community
fborges555
Enthusiast
Enthusiast

VM and Time Zone

Hi Gurus

I am looking for a script that will list the name of a VM and its Timezone, I came across the following but the timezone comes empty

Get-VM -Location (Get-Folder "Workstations-Call Center") | Where { $_.PowerState -eq "PoweredOn" } | select Name, @{ Name="Time Zone"; Expression={(Get-WmiObject -Class win32_TimeZone -Comp $_.Guest.HostName).Caption}}

 it does list the name of the VM but not its timezone,

Any help

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Is WinRM enabled on those remote Guest OS running on those VMs?
Is the user running that code in the local administrator group of the remote Guest OS?

If you have VMware Tools installed, you can run that Get-WmiObject cmdlet, without the ComputerName parameter, inside the Guest OS via Invoke-VMScript.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
fborges555
Enthusiast
Enthusiast

Lucd.

Thanks a bunch, all VM has the VMware tool installed, I will try that suggestion and let you know.

 

Thanks again

 

Reply
0 Kudos