kavya m

kavya m

  • NA
  • 139
  • 21.1k

Acess extension attributes from active directory c#

Dec 19 2022 12:11 AM

Acess all attributes from active directory

Please let me know how to fix this issue .

 

DirectorySearcher searcher = new DirectorySearcher(a,b);
SearchResult result = searcher.FindOne();
DirectoryEntry dsresult = result.GetDirectoryEntry();

 

 

LDAP Error (0x800500c) when acessing extensionattribtes,works as expected for some attributes

when trying to acess property from dsresult  getting error:(Activedirectory searh result)

'dsresult.Properties["extensionAttribute1"]' threw an exception of type 'System.Runtime.InteropServices.COMException'

 at System.DirectoryServices.PropertyValueCollection.PopulateList()

 at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)
   at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)


Answers (1)