2

After a long period of search I decide to ask my own question about my problem.

I try to get the value of a Property in Active Directory, but I always get a System.__ComObject.

correspondance += compte.Properties["ENTPersonDateNaissance"][0];

I have tried to use :

 Microsoft.VisualBasic.Information.TypeName(compte.Properties["ENTPersonDateNaissance"]

The result is PropertyValueCollection

But I don't know how to get the value?

MeTaLiKiD
  • 395
  • 3
  • 11

1 Answers1

2

In fact, the variable "compte" is of type DirectoryEntry, I switched it to SearchResult, and now I can access it value with :

compte.Properties["ENTPersonDateNaissance"][0].ToString()

I hope it can help.

MeTaLiKiD
  • 395
  • 3
  • 11
  • Hey i am having similar problem. can you help? – Karen Apr 29 '16 at 18:04
  • 1
    My object "compte" was a DirectoryEntry and I don't figure out but when I use the SearchResult instead of the SerarchResult.GetDirectoryEntry I can access the value that I want to get. Hope this can help – MeTaLiKiD May 01 '16 at 20:49