Get Time From Remote Windows PC
I noticed some drift on our server from the correct time from NTP. After resyncing I wanted to ensure the clients were updated also. I didnt want to interrupt the users so I used a VBScript to remotely get the time from a specific computer. Just specify the computer name and run the VBS:
strComputer = "computername" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_LocalTime") For Each objItem in colItems strTime = objItem.Hour & ":" & objItem.Minute & ":" & objItem.Second dtmTime = CDate(strTime) Wscript.Echo FormatDateTime(dtmTime, vbFormatLongTime) Next |