Track the user login

By chaudhary.umesh ·
I have a DC on windows 2000 server i want to track the user login and logoff time and date through login script can anybody will help me on this ?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

This is what I do.

by jeff.doty In reply to Track the user login


Here is an excerpt from my logon scripts. Note that I use VBScripts for logon scripts. If you us batch files, you can just call the VBScript.

' Dimention Variables
Dim objNetwork, colPrinters, objFSO, objShell, objProcessEnvironment
' Setup Objects
Set objShell = WScript.CreateObject("WScript.Shell")
Set objProcessEnvironment = objShell.Environment("Process")
' Set Variables
EnvLogonServer = objProcessEnvironment("LogonServer")
PCName = objProcessEnvironment("COMPUTERNAME")
UserName = objProcessEnvironment("USERNAME")
' Add Logon event to Event Log
Msg1 = "Logon Event for User: " & UserName
Msg2 = ", Logged on PC: " & PCName
Msg3 = ", Logon Server: " & EnvLogonServer
Msg = Msg1 & Msg2 & Msg3
objShell.LogEvent 8, Msg

This will put an entry into the Application Event Log.

Related Discussions

Related Forums