Hi, I've been trying to look around the various .NET class library's for some where I can get the logged in user of the local machine, either connected to a domain or not. So far
System.Security.Principal.WindowsPrincipal LoggedUser = System.Threading.Thread.CurrentPrincipal as
System.Security.Principal.WindowsPrincipal;
// This returns the username
LoggedUser.Identity.Name
This will return the user's name, however is there any way of getting the session details, something that you would see in AD or user logged in, session duration, etc.. the context of the user, actions such as Workstation locked, the presence of the user basiclly.
If you have any idea, it would be much appreciated. Thanks in advance.