如何获得用户使用WINNT协议的Active Directory GUID? [英] How to get user GUID from Active Directory using WinNT protocol?

查看:271
本文介绍了如何获得用户使用WINNT协议的Active Directory GUID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让用户从Active Directory GUID。我的code:

I'm trying to get user GUID from Active Directory. My code:

DirectoryEntry entry = new DirectoryEntry("WinNT://DOMAIN/UserName");
Console.WriteLine("The GUID of the ADS object:" + entry.Guid);
Console.WriteLine("The Native GUID of the ADS object:" + entry.NativeGuid);

在code以上总是返回用户和域的d83f1060-1e71-11cf-b1f3-02608c9e7553无关。

The code above always returns d83f1060-1e71-11cf-b1f3-02608c9e7553, regardless of the user and domain.

是否有可能使用GUID WINNT协议来获得用户?

Is it possible to get user GUID using WinNT protocol?

推荐答案

查看理查德·穆勒的山顶实验室,他有很多第preadsheets显示所有属性不同的供应商公开。尤其是他的WinNT提供程序公开的属性列表显示,有没有这样的事情作为用户的GUID或OID或类似的东西暴露出来。

Check out Richard Mueller's Hilltop Lab where he has lots of spreadsheets showing all the properties the various providers expose. In particular, his list of properties that the WinNT provider exposes shows that there's no such things as a user's "GUID" or OID or anything like that exposed.

提醒你 - WinNT提供程序仅用于向后兼容,并且真的只有行之有效的本地计算机上的帐户

Mind you - the WinNT provider is only used for backward compatibility, and really only works well on local machine accounts.

如果您要访问域帐户,你应该通过各种手段使用LDAP提供商,而不是 - 它会给你访问到所有LDAP属性上的用户帐户

If you want to access DOMAIN accounts, you should by all means use the LDAP provider instead - it'll give you access to all the LDAP properties on a user account.

马克·

这篇关于如何获得用户使用WINNT协议的Active Directory GUID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆