Dim strHostName, strSearchFoR
Set objComputer = CreateObject("Shell.LocalMachine")
Set objShell = CreateObject("WScript.Shell")
strHostName = UCase(objComputer.MachineName) strSearchFor = UCase("Term")
Step 2 of 2:
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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"
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.
Related Q&A from Christa Anderson
Expert Christa Anderson offers some ideas for monitoring who is connecting to a terminal server, and when they are connecting.continue reading
Expert Christa Anderson advises how to map images on a network share for user on a terminal server.continue reading
Expert Christa Anderson offers advice for dealing with a crashing spooler service.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.