Home All Groups Group Topic Archive Search About

Monitoring logon-logoff events

Author
2 Oct 2006 8:28 AM
marek zegarek
Hello!

1) How can I monitor events in Windows?
I need to catch login and logoff on Windows XP.

2) I will use it to build NT Service monitoring login type -  by smartcard
or by password.

Maybe something by WMI? But what i must do?

Author
2 Oct 2006 10:09 PM
Chris Taylor
Hi,

I am not aware of any way to do this reliably with .NET. However with some
basic C/C++ you can do it quite easily.

You need to create a dll which exports functions to handle each event you
are interested in. Then you can register the dll in the registry under the
following location

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify
You can handle events like: Logon, Logoff, StartScreenSaver,
StopScreenSaver, StartShell, Startup, Shutdown, Lock, Unlock

If you want to go this route feel free to post here if you need some
assistance, I will gladly provide more detailed explanation. Also the
following link could get you going
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/creating_a_winlogon_notification_package.asp

Hope this helps

Show quote
"marek zegarek" <ma***@zegarek.pl> wrote in message
news:OXt0vyf5GHA.3592@TK2MSFTNGP05.phx.gbl...
> Hello!
>
> 1) How can I monitor events in Windows?
> I need to catch login and logoff on Windows XP.
>
> 2) I will use it to build NT Service monitoring login type -  by smartcard
> or by password.
>
> Maybe something by WMI? But what i must do?
>
Author
3 Oct 2006 6:08 AM
marek zegarek
Thanks for an answer!
Yesterday i looked into MSGina.dll and i saw this methods.
I'm developing in vb.net, so C/C++ is teribble for me, but i must try :)
Do you know where can i find any examples how to implement any function from
winlogon notification?


Show quote
U¿ytkownik "Chris Taylor" <chris_taylor***@hotmail.com> napisa³ w wiadomo¶ci
news:uUC5s9m5GHA.3952@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> I am not aware of any way to do this reliably with .NET. However with some
> basic C/C++ you can do it quite easily.
>
> You need to create a dll which exports functions to handle each event you
> are interested in. Then you can register the dll in the registry under the
> following location
>
> HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify
> You can handle events like: Logon, Logoff, StartScreenSaver,
> StopScreenSaver, StartShell, Startup, Shutdown, Lock, Unlock
>
> If you want to go this route feel free to post here if you need some
> assistance, I will gladly provide more detailed explanation. Also the
> following link could get you going
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/creating_a_winlogon_notification_package.asp
>
> Hope this helps
>
> --
> Chris Taylor
> http://dotnetjunkies.com/weblog/chris.taylor
> "marek zegarek" <ma***@zegarek.pl> wrote in message
> news:OXt0vyf5GHA.3592@TK2MSFTNGP05.phx.gbl...
>> Hello!
>>
>> 1) How can I monitor events in Windows?
>> I need to catch login and logoff on Windows XP.
>>
>> 2) I will use it to build NT Service monitoring login type -  by
>> smartcard or by password.
>>
>> Maybe something by WMI? But what i must do?
>>
>
>
Author
3 Oct 2006 5:31 PM
Chris Taylor
Hi,

I did a quick google search and came up with this.
http://www.codeproject.com/system/winlogon_notification_package.asp

Hope this helps

Show quote
"marek zegarek" <ma***@zegarek.pl> wrote in message
news:uLpLhJr5GHA.1244@TK2MSFTNGP03.phx.gbl...
> Thanks for an answer!
> Yesterday i looked into MSGina.dll and i saw this methods.
> I'm developing in vb.net, so C/C++ is teribble for me, but i must try :)
> Do you know where can i find any examples how to implement any function
> from winlogon notification?
>
>
> U¿ytkownik "Chris Taylor" <chris_taylor***@hotmail.com> napisa³ w
> wiadomo¶ci news:uUC5s9m5GHA.3952@TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> I am not aware of any way to do this reliably with .NET. However with
>> some basic C/C++ you can do it quite easily.
>>
>> You need to create a dll which exports functions to handle each event you
>> are interested in. Then you can register the dll in the registry under
>> the following location
>>
>> HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify
>> You can handle events like: Logon, Logoff, StartScreenSaver,
>> StopScreenSaver, StartShell, Startup, Shutdown, Lock, Unlock
>>
>> If you want to go this route feel free to post here if you need some
>> assistance, I will gladly provide more detailed explanation. Also the
>> following link could get you going
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/creating_a_winlogon_notification_package.asp
>>
>> Hope this helps
>>
>> --
>> Chris Taylor
>> http://dotnetjunkies.com/weblog/chris.taylor
>> "marek zegarek" <ma***@zegarek.pl> wrote in message
>> news:OXt0vyf5GHA.3592@TK2MSFTNGP05.phx.gbl...
>>> Hello!
>>>
>>> 1) How can I monitor events in Windows?
>>> I need to catch login and logoff on Windows XP.
>>>
>>> 2) I will use it to build NT Service monitoring login type -  by
>>> smartcard or by password.
>>>
>>> Maybe something by WMI? But what i must do?
>>>
>>
>>
>
>
Author
4 Oct 2006 7:04 AM
marek zegarek
Thanks! That is very usefull for me!

I looked in google and i cannot find any sample with
WlxGetOption


Show quote
U¿ytkownik "Chris Taylor" <chris_taylor***@hotmail.com> napisa³ w wiadomo¶ci
news:OYKUPHx5GHA.4064@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I did a quick google search and came up with this.
> http://www.codeproject.com/system/winlogon_notification_package.asp
>
> Hope this helps
>
> --
> Chris Taylor
> http://dotnetjunkies.com/weblog/chris.taylor
> "marek zegarek" <ma***@zegarek.pl> wrote in message
> news:uLpLhJr5GHA.1244@TK2MSFTNGP03.phx.gbl...
>> Thanks for an answer!
>> Yesterday i looked into MSGina.dll and i saw this methods.
>> I'm developing in vb.net, so C/C++ is teribble for me, but i must try :)
>> Do you know where can i find any examples how to implement any function
>> from winlogon notification?
>>
>>
>> U¿ytkownik "Chris Taylor" <chris_taylor***@hotmail.com> napisa³ w
>> wiadomo¶ci news:uUC5s9m5GHA.3952@TK2MSFTNGP04.phx.gbl...
>>> Hi,
>>>
>>> I am not aware of any way to do this reliably with .NET. However with
>>> some basic C/C++ you can do it quite easily.
>>>
>>> You need to create a dll which exports functions to handle each event
>>> you are interested in. Then you can register the dll in the registry
>>> under the following location
>>>
>>> HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify
>>> You can handle events like: Logon, Logoff, StartScreenSaver,
>>> StopScreenSaver, StartShell, Startup, Shutdown, Lock, Unlock
>>>
>>> If you want to go this route feel free to post here if you need some
>>> assistance, I will gladly provide more detailed explanation. Also the
>>> following link could get you going
>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/creating_a_winlogon_notification_package.asp
>>>
>>> Hope this helps
>>>
>>> --
>>> Chris Taylor
>>> http://dotnetjunkies.com/weblog/chris.taylor
>>> "marek zegarek" <ma***@zegarek.pl> wrote in message
>>> news:OXt0vyf5GHA.3592@TK2MSFTNGP05.phx.gbl...
>>>> Hello!
>>>>
>>>> 1) How can I monitor events in Windows?
>>>> I need to catch login and logoff on Windows XP.
>>>>
>>>> 2) I will use it to build NT Service monitoring login type -  by
>>>> smartcard or by password.
>>>>
>>>> Maybe something by WMI? But what i must do?
>>>>
>>>
>>>
>>
>>
>
>
Author
4 Oct 2006 8:42 PM
Chris Taylor
Hi,

For WlxGetOption you will actually have to write your own replacement GINA
dll, for many of the functions you could pass through to the original GINA
dll. This if course is a whole other excersize compared to just using the
WinLogon Notifications.

Show quote
"marek zegarek" <ma***@zegarek.pl> wrote in message
news:%235JhmN45GHA.4476@TK2MSFTNGP04.phx.gbl...
> Thanks! That is very usefull for me!
>
> I looked in google and i cannot find any sample with
> WlxGetOption
>
>
> U¿ytkownik "Chris Taylor" <chris_taylor***@hotmail.com> napisa³ w
> wiadomo¶ci news:OYKUPHx5GHA.4064@TK2MSFTNGP03.phx.gbl...
>> Hi,
>>
>> I did a quick google search and came up with this.
>> http://www.codeproject.com/system/winlogon_notification_package.asp
>>
>> Hope this helps
>>
>> --
>> Chris Taylor
>> http://dotnetjunkies.com/weblog/chris.taylor
>> "marek zegarek" <ma***@zegarek.pl> wrote in message
>> news:uLpLhJr5GHA.1244@TK2MSFTNGP03.phx.gbl...
>>> Thanks for an answer!
>>> Yesterday i looked into MSGina.dll and i saw this methods.
>>> I'm developing in vb.net, so C/C++ is teribble for me, but i must try :)
>>> Do you know where can i find any examples how to implement any function
>>> from winlogon notification?
>>>
>>>
>>> U¿ytkownik "Chris Taylor" <chris_taylor***@hotmail.com> napisa³ w
>>> wiadomo¶ci news:uUC5s9m5GHA.3952@TK2MSFTNGP04.phx.gbl...
>>>> Hi,
>>>>
>>>> I am not aware of any way to do this reliably with .NET. However with
>>>> some basic C/C++ you can do it quite easily.
>>>>
>>>> You need to create a dll which exports functions to handle each event
>>>> you are interested in. Then you can register the dll in the registry
>>>> under the following location
>>>>
>>>> HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify
>>>> You can handle events like: Logon, Logoff, StartScreenSaver,
>>>> StopScreenSaver, StartShell, Startup, Shutdown, Lock, Unlock
>>>>
>>>> If you want to go this route feel free to post here if you need some
>>>> assistance, I will gladly provide more detailed explanation. Also the
>>>> following link could get you going
>>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/creating_a_winlogon_notification_package.asp
>>>>
>>>> Hope this helps
>>>>
>>>> --
>>>> Chris Taylor
>>>> http://dotnetjunkies.com/weblog/chris.taylor
>>>> "marek zegarek" <ma***@zegarek.pl> wrote in message
>>>> news:OXt0vyf5GHA.3592@TK2MSFTNGP05.phx.gbl...
>>>>> Hello!
>>>>>
>>>>> 1) How can I monitor events in Windows?
>>>>> I need to catch login and logoff on Windows XP.
>>>>>
>>>>> 2) I will use it to build NT Service monitoring login type -  by
>>>>> smartcard or by password.
>>>>>
>>>>> Maybe something by WMI? But what i must do?
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

AddThis Social Bookmark Button