We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

wmi experts

sirbounty
sirbounty asked
on
Medium Priority
667 Views
Last Modified: 2012-08-14
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?
Comment
Watch Question

Commented:
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

Commented:
using objClass.Description will print out the selection for the timezone as well (i.e. eastern, pacific, etc.)
Commented:
Sounds like the server allows for daylight time, before which ET is GMT-5, after which it's GMT-4.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Top Expert 2007

Author

Commented:
Completely forgot about that...<g>...thanx.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.