我正在尝试从Active Directory获取用户GUID。我的代码:如何使用WinNT协议从Active Directory获取用户GUID?
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);
就永远代码返回d83f1060-1e71-11cf-b1f3-02608c9e7553,无论用户和域。
是否有可能使用WinNT协议获取用户GUID?
我同意NT只是抓住用户名是好的,但你应该使用LDAP这样的东西。 – PeteT 2009-05-06 07:59:37