How to detect windows login event?

How do you detect a Windows login event?

And how do you initiate a user login from a Windows service?

I am trying to write a piece of code that will detect login events and write another file automatically.

+3
source share
5 answers

How do you detect a Windows login event?

If any mechanism exists, it will most likely be in WMI. There are several WMI classes. Noteworthy Win32_LogonSession; which is associated with Win32_Accountthrough Win32_LoggedonUser). If creation events are supported for Win32_LogonSession, then this will be a very efficient method.

And how do you initiate a user login from a Windows service?

API LogonUser , . CreateProcessWithLogonW ( ) ( LogonUser plus CreateProcessWithTokenW).

+2

Windows 2000/XP, Winlogon, JWA Delphi. :

http://blog.delphi-jedi.net/2008/05/27/winlogon-notification-package/

CTRL + ALT + DEL, . SYSTEM.

+2

, , . , .

, , - , . , .

+1

Winlogon Vista.

WTSRegisterSessionNotification (SENS). s.t. , . winlogon, . LogonUser , .

+1

Source: https://habr.com/ru/post/1718089/


All Articles