I am trying to inspect various .NET class libraries for some, where I can get a registered user of the local machine, either connected to the domain or not. Till
System.Security.Principal.WindowsPrincipal LoggedUser = System.Threading.Thread.CurrentPrincipal as
System.Security.Principal.WindowsPrincipal;
LoggedUser.Identity.Name
This will return the username, however, is there a way to get session information, what you see in AD or logged in, session duration, etc. user context, actions such as workstation locked, basiclly user presence.
If you have any ideas, it will be very appreciated. Thanks in advance.
source
share