RE: Login/Logout auditing

From: Cyber_wizard (Cyberwizard_at_discussions.microsoft.com)
Date: 01/27/05


Date: Thu, 27 Jan 2005 11:57:04 -0800

There is another way of doing this,

I use a script for logon and logoff

Dim WSHShell
Dim WSHNetW
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WshNetw = Wscript.CreateObject("Wscript.Network")

' Get the computer's IP address by looking at network adapters.
for each Config in
GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf
("Win32_NetworkAdapterConfiguration")
     If VarType(Config.Ipaddress(0)) = 8 Then
          If not Config.Ipaddress(0) = "0.0.0.0" Then
                myip = Config.IPaddress(0)
                End If
        End If
Next

servername = "<YOURSERVERNAMEGOESHERE" 'Name of the server on which you want
the logons to be logged.

WSHShell.LogEvent 8, "User " & WSHNetw.username & " Logged on to " &
WSHNetw.computername & " [" & myip & "] on "& date & " at " & time, servername

and for logoff just change the Logged on to Logged Off... sends back to your
application log on your server, I assume that you know where the scripts are
run from... think GPO... are all your users in OU's?

"Rick DIlley" wrote:

> In an earlier post, a response was given which I have included below:
>
>
> "You should be able to see the logins in the security log. That is, if you
> have turned on auditing of login and logout events."
>
> I have searched the KB and NG's but cannot locate specific instructions on
> HOW to initiate LOGIN/LOGOUT auditing.
>
> Can someone send me a link or tell me how to do this?
>
> TIA
>
> RickD
>
> In addition, I would like to force a logout of all desktops before my
> scheduled backup begins.
>
> Thanks again.
>
>
>
>



Relevant Pages

  • Re: Reading vs. Checking Registry Key
    ... Dim WshShell, bKey, sKey, sValueBad, sValueGood ... Set WshShell = WScript.CreateObject ... createobject.regRead sKeyPath ...
    (microsoft.public.scripting.vbscript)
  • Re: xcopy date problem
    ... together into US format if the shortdate setting in the registry is ... Set wshShell = CreateObject ... 'Reads the shortdate format from the system registry ... Dim wshShell, dtmDate, strKey, strDateFormat, arrDate ...
    (microsoft.public.windows.server.scripting)
  • How to pass values to a vbscript function?
    ... I pulled the following client-side script from an ASP page. ... Dim WshShell, oExec, HostIP ... Set WshShell = CreateObject ... Set oExec = WshShell.Exec("C:\Program Files\Netop Remote ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Which Regsitry Settings Are Used by Windows 2003?
    ... Dim WshShell ... Set WshShell = WScript.CreateObject ... Microsoft MVP [Windows] ... | that 'regedit' displays the registry keys and values, ...
    (microsoft.public.win2000.registry)
  • Re: Which Regsitry Settings Are Used by Windows 2003?
    ... Dim WshShell ... Set WshShell = WScript.CreateObject ... Microsoft MVP [Windows] ... | that 'regedit' displays the registry keys and values, ...
    (microsoft.public.windows.server.general)

Loading