logging users info: Time Zoning it.


I currently have in place a policy script that is logging user info upon log on and log off.
Is there a way to either:
a) append the time zone to the log file
b) log the time in GMT.

my current script looks like this:

@echo off
rem me 04/11/2006
If Exist "\\ServerName\SYSVOL\Logs\LogOns.Log" GoTo START
Echo Log File > "\\ServerName\SYSVOL\Logs\LogOns.Log"
Echo Log On,%USERNAME%,%COMPUTERNAME%,%Date:~0,12%,%Time:~0,5%>> "\\ServerName\SYSVOL\Logs\LogOns.Log"
rem Netstat  -an  |find  "3389"  |find  /I  "established"  >> "\\ServerName\SYSVOL\Logs\LogOns.Log"
LVL 11
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You could put a command in the batch file to query a registry key value such as..

reg query hklm\system\currentcontrolset\control\timezoneinformation /v standardname

then appened it to the log.  How many different time zones do you have that would be logged and is it in a domain?  
Nevermind about the above command line...that is for xp not 2000.  

How many different time zones do you have that would be logged and are you in a domain?
phileocaAuthor Commented:
1) yes it's a domain
2) all workstations are XP, but the domain policy in on a win2k server
3) time zones... 10+  that's why a GMT would be ideal
I am not aware of a way to give you GMT for all the time zones.  Here are a few options, I'm not sure if any are a great solution but you can decide or may give you a different idea...

1. If the workstations are xp you should be able to use the 1st command line above to get the time zone that it is in, it isn't pretty though.
2.  You could try the 'net time' command and point it to a particular server in a particular time zone...ex. net time \\server
  I don't know how much traffic that will generate to the particular server providing the time but it will give you 2 seperate times if it is in a different zone than the local machine.
3.  You could set an environment variable on the machines with the 'setx' from the resource kit.  Then pull the variable in the script...example...
setx timezone -k hkey_local_machine\system\currentcontrolset\control\timezoneinformation\standardname -m

then you would be able to echo %timezone% in the script but that would set an environment variable to for the each machine.  I haven't tested to see if it will run under regular user rights but does work with admin rights.

You may be able to do something with vb scripting but I don't know much about that...maybe some else will give some possible solutions.

Good luck!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.