简体   繁体   English

获取用户的登录类型

[英]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. 通过类型,我的意思是用户是否通过电话连接到我们的域以查看电子邮件,或者用户是否在笔记本电脑上并通过VPN连接,或者仅是普通桌面身份验证。

I need this because we have a policy here that a person who has not logged on in over 10 days must be disabled. 我需要这样做是因为我们这里有一项政策,即必须禁止未登录10天以上的人。 I am not seeing anything obvious on the MSDN site, nor anything relevant in any posts. 我没有在MSDN站点上看到任何明显的内容,也没有在任何帖子中看到任何相关的内容。

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. 我希望在C#中执行此操作,因为C#中已经有一些其他的类库在执行其他一些AD函数,并且希望将其添加到该解决方案中。

thanks. 谢谢。

I have found this CodeProject article that describes almost everything you can do with windows user, including getting domain information. 我发现这篇CodeProject文章几乎描述了Windows用户可以执行的所有操作,包括获取域信息。

Howto: (Almost) Everything In Active Directory via C# 如何:(几乎)通过C#将Active Directory中的所有内容

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. 然后,用户部分的任何交互都可以用来直接确认他们正在使用的计算机,无论是iPhone,Android,WindowPhone还是标准计算机。 You'd have to code that with a little JS but it would allow you to very simply add that to any logs. 您必须使用一些JS进行编码,但这将使您可以非常简单地将其添加到任何日志中。

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. 在此处可以找到简单的方法http://www.w3schools.com/js/js_window_navigator.asp,但也许更好的方法是使用对象检测,它可以通过直接测试某些功能来找到浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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