How to reliably capture Windows logon event from a service using VB.net or c#.net?
Thanks,
Ram
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Benjamin KemnerPosted Aug 25, 2011, 4:41 AM
// overwrite OnSessionChange in your ServiceBase class
protected override void OnSessionChange(SessionChangeDescription changeDescription)
{
if(changeDescription.Reason == SessionChangeReason.SessionLogon)
{
// do all your stuff
}
}
Benjamin KemnerPosted Aug 26, 2011, 4:01 AM
Suthish NairPosted Aug 25, 2011, 11:54 AM
RamsPosted Aug 25, 2011, 9:13 AM
Thanks a lot, it worked for me.