logging users info: Time Zoning it.

greetings,

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
:Logging
If Exist "\\ServerName\SYSVOL\Logs\LogOns.Log" GoTo START
Echo Log File > "\\ServerName\SYSVOL\Logs\LogOns.Log"
:START
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
phileocaAsked:
Who is Participating?
 
la_pepe59Commented:
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!
0
 
la_pepe59Commented:
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?  
0
 
la_pepe59Commented:
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?
0
 
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.