真实用户和系统用户帐户之间的区别
当我获取计算机或 Active Directory 域的 UserPrincipal/DirectoryEntry 记录时,是否有办法区分系统帐户和真实用户?
例如,jsmith 是真实用户,而 ASPNET 或 IUSR_machine 则不是。但依赖硬编码的已知名称似乎并不是过滤系统用户的最佳方法,因为也可能存在其他帐户。有更好的办法吗?
例如,可能存在“可以交互登录”标志,或者通过检查密码是否设置等进行检测。
When I get UserPrincipal/DirectoryEntry records for a machine or Active Directory domain, is there a way to differentiate system accounts from real users?
For example, jsmith is a real user, while ASPNET or IUSR_machine are not. But relying on hard-coded known names doesn't seem to be the best way to filter out system users, because, there can be other accounts, too. Is there a better way?
For example, maybe there is "can logon interactively" flag, or, detect by checking that password is set, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
出于所有意图和目的,您列出的示例帐户在功能上与您为指定人员创建的用户帐户相同。
The sample accounts you list are, for all intents and purposes, functionally the same as a user account you create for a named person.
尝试 Win32 LookupAccountName 和 LookupAccountSid 方法。当函数返回时,最后一个参数(称为 accountType)将填充帐户类型。
Try the Win32 LookupAccountName and LookupAccountSid methods. The last parameter (called accountType) is filled with the type of account, when the function returns.
尝试使用 "samaccountname" 属性 消除不适合用户或组的帐户。
Try using the "samaccountname" property to eliminate accounts that are not for users or groups.