Q

How do I change the time zone of a user's session and not the local machine?

Expert Christa Anderson offers a reader a helpul tool for changing the time zone of a user's session.

I'm in a situation where I need to set a user's time zone on a terminal server session. The trick is that the user is using such an old thin client, that the thin client does not have a local time zone to pass. I have created a script to change the time zone based on a membership of an Active Directory group. However, the script is changing the time zone of the terminal server itself instead of the user's terminal server session. I have included the script. Any suggestions on changing only the time zone of the user's session and not of the local machine?
Dim strHostName, strSearchFoR
Set objComputer = CreateObject("Shell.LocalMachine")
Set objShell = CreateObject("WScript.Shell")

strHostName = UCase(objComputer.MachineName) strSearchFor = UCase("Term")

If InStr(1, strHostName, strSearchFor) > 0 then
wscript.echo "Changing Time Zone to Arizona"
objShell.Run "CONTROL.EXE TIMEDATE.CPL,,/Z Us Mountain Standard Time"
End If

Unfortunately, I don't think you can do this the way you're doing it. The problem is, although there is a WMI object representing terminal server sessions, it does not include the time zone property. In short, we can't get to this information via VBScript and, as you saw, setting it on the terminal server changes it for everybody. You might try a product called Time Machine to see if this user-based time-setting tool can help you. I have not tried this tool, but it looks like it answers your question.

This was first published in October 2006

Dig deeper on Windows Operating System Management

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close