[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

wmi experts

Thought this was working, but second glance shows 'no'...
I'm running this on a server in EST.  The .CurrentTimeZone should reveal -300, but shows -240 instead.

set oQuery=oWMI.ExecQuery("select * from Win32_ComputerSystem")
wscript.echo .CurrentTimeZone

Any idea(s) why?
0
sirbounty
Asked:
sirbounty
  • 2
1 Solution
 
sr75Commented:
Why do you need the TimeZone??

Try using Win32_TimeZone anyways and see if you get a change.

<  script >

Option Explicit

Dim objWMI
Dim colClass
Dim objClass
Dim strComputer

strComputer = "."
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colClass = objWMI.ExecQuery("Select * from Win32_TimeZone",,48)

On Error Resume Next

For Each objClass in colClass
      WScript.Echo "Bias: " & objClass.Bias
Next

Set objWMI = Nothing
Set colClass = Nothing
Set objClass = Nothing
0
 
sr75Commented:
using objClass.Description will print out the selection for the timezone as well (i.e. eastern, pacific, etc.)
0
 
cookreCommented:
Sounds like the server allows for daylight time, before which ET is GMT-5, after which it's GMT-4.
0
 
sirbountyAuthor Commented:
Completely forgot about that...<g>...thanx.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now