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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Benjamin KemnerRank #7,492 · 240 reputationPosted Aug 25, 2011, 12:41 AM EDT
// overwrite OnSessionChange in your ServiceBase class
protected override void OnSessionChange(SessionChangeDescription changeDescription)
{
if(changeDescription.Reason == SessionChangeReason.SessionLogon)
{
// do all your stuff
}
}
Rams39 reputationPosted Aug 25, 2011, 5:13 AM EDT
Thanks a lot, it worked for me.
Suthish NairRank #92 · 22.8K reputationPosted Aug 25, 2011, 7:54 AM EDT
Benjamin KemnerRank #7,492 · 240 reputationPosted Aug 26, 2011, 12:01 AM EDT