This question might be a little bit off topic but it refers to the same problem of setting time sync in a bunch of Windows guests.
Is there also the possibility to deactivate the Time Service in Windows guests using Power Shell? KB article http://kb.vmware.com/kb/1318 stats that this should be done when configuring the VMware Tools for being responsible for time sync.
I haven't tried it but how about:
Set-Service w32time -StartupType Disabled
thanks for the suggestion after a little playing around I found a way to do this remotely:
to start: (Get-WmiObject -computer <put-computername-here> Win32_Service -Filter "Name='w32Time'").StartService()
to stop: (Get-WmiObject -computer <put-computername-here> Win32_Service -Filter "Name='w32Time'").StopService()
for status query: Get-WmiObject -computer <put-computername-here> Win32_Service -Filter "Name='w32Time'"
Is it possible to query for time sync in VI SDK 2.0.1?
We are just running VC 2.0.2
Is there any pre-requisites to using this? I have powershell and the vm pack installed ... I however get failures about $host.SetShouldExit
Not sure if I need to set something before hand?
Shouldn't be any prerequisites. I don't understand your error, could you post the error message?
I managed to get it sorted over the weekend - so all is well. I actually used your script and formatted it like another post which was setting the tools upgrade flag. If it useful I can post this as well?
I wanted to run an audit of the syncTimeWithHost property (rather than just set it across all VMs). However, whenever I look at my VMs, this property is always null, e.g.
$vm = Get-VM -name server
$view = get-view $vm.ID
$config = $view.config
$tools = $config.tools
ToolsVersion : 55869
AfterPowerOn : True
AfterResume : True
BeforeGuestStandby : True
BeforeGuestShutdown : True
BeforeGuestReboot : False
Why is the SyncTimeWithHost property always null (even though it is set as true withint the VMTools gui on the guest)?
Any ideas? Many thanks.