简体   繁体   中英

Get the type of logon for a user

Hi I am working on a project and need to get the type of logon for each user on the domain. By type I mean if the user connected to our domain via their phone to check e-mail, or if they are on a laptop and connected through a VPN, or just the plain desktop authentication.

I need this because we have a policy here that a person who has not logged on in over 10 days must be disabled. I am not seeing anything obvious on the MSDN site, nor anything relevant in any posts.

any help would be greatly appreciated. I am looking to do this in C#, as I already have a few other class libraries in C# doing some other AD functions and want to just add this into that solution.

thanks.

I have found this CodeProject article that describes almost everything you can do with windows user, including getting domain information.

Howto: (Almost) Everything In Active Directory via C#

Assuming you've already got the logon, browser could give you device information.

I would think that a browser check might be the way to go. Any interaction on the part of your users could then be used to directly confirm which machine they are using, be it iPhone, Android, WindowPhone, or standard computer. You'd have to code that with a little JS but it would allow you to very simply add that to any logs.

Simple way can be found here http://www.w3schools.com/js/js_window_navigator.asp but a perhaps better way would be with object detection, which would find browser by directly testing for certain features.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM