ADSI: DirectoryEntry-problem with access PropertyCollection
От: beginner  
Дата: 08.04.03 13:01
Оценка:
Пытаюсь по логину юзера вытащить его full name используя AD через LDAP провайдера.
На одной машине код
DirectoryEntry entry = new DirectoryEntry(this.LDAPProviderPath);
System.DirectoryServices.DirectorySearcher searcher = new 
System.DirectoryServices.DirectorySearcher(entry);
searcher.Filter = "(SAMAccountName=" + login + ")";            
searcher.PropertiesToLoad.Add("displayName");
SearchResult result =  searcher.FindOne();
string fullName = result.Properties["displayName"][0].ToString();

Не вызывает никаких проблем.
На другой вызывает не совсем понятный ексепшн

Handling of this ADSVALUE type is not yet implemented (type = 0xb).

Единственный вразумительный совет, который я нашел в Инете — это юзание DirectoryEntry.Invoke

Увы
string fullName = result.GetDirectoryEntry().Invoke("Get","displayName").ToString();

приводит к

The Active Directory datatype cannot be converted to/from a native DS datatype


Никто с подобным не сталкивался?

Спасибо!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.