Re: Record User Logon/Logoff with Computer Name + Username



What I do is to collect the information I need at logon and logoff time
using the script below.
This scripts writes to the client's event viewer.
You can rather easily modify it to write to a text file in a network
location or even a sql database.

Set sho = CreateObject("Wscript.Shell")
set sysi = createobject("ADSystemInfo")
strUser=sysi.UserName
strComputer = sysi.ComputerName
set objUser=GetObject("LDAP://"; & strUser)
sho.LogEvent 4,"User " & objUser.samaccountName & " has logged on at "
& now & " from " & ComputerName

Hope this helps.

.



Relevant Pages

  • Re: Log report on clients
    ... quick logon script that would write a small note in your event viewer ... Set sho = CreateObject ... The above script could also track reconnections and disconnections ...
    (microsoft.public.windows.terminal_services)
  • Pls help - script that copies c:windowssystem32configSecEvent.
    ... The guys in the scripting groups should be able to give you a WMI script ... Johnny Mac wrote: ... applications (Like Event Viewer) to review or move the file. ... Event Manager the file is always corrupt. ...
    (microsoft.public.scripting.vbscript)
  • Re: Has anyone had issues with VBscripts since installing Service Pack
    ... JScript scripts in Windows Vista Service Pack 1, in Windows Server 2008, ... You can access Event Viewer by selecting Start, Control Panel, ... the application that the script did interact with is ...
    (microsoft.public.windowsxp.help_and_support)
  • IIS 7 Event ID 9
    ... About once a day, we are getting a warning in Event Viewer, ... The maximum amount of time for a script to execute ... property Server.ScriptTimeout or by changing the value in the IIS ...
    (microsoft.public.inetserver.iis)
  • Re: Copying the SecEvent.Evt file
    ... The guys in the scripting groups should be able to give you a WMI script to do this. ... Johnny Mac wrote: ... I know the main problem is the SecEvent.Evt file is a active file and requires applications (Like Event Viewer) to review or move the file. ... When I perform a typical copy and paste and I view the file using Event Manager the file is always corrupt. ...
    (microsoft.public.windowsxp.security_admin)