1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Private Function GetTimeZone(ByVal Computer As String) As String
Dim objWMIService As Object
Dim objItems As Object
Dim objItem As Object
GetTimeZone = ""
objWMIService = GetObject("winmgmts:\\" & Computer & "\root\CIMV2")
objItems = objWMIService.ExecQuery("SELECT * FROM Win32_TimeZone")
For Each objItem In objItems
Return objItem.Caption
Next
objWMIService = Nothing
objItems = Nothing
objItem = Nothing
End Function
|