C # get obscure Active Directory attributes

I am trying to get some interesting Active Directory attributes:

  • msexchmailboxsecuritydescriptor and
  • terminalervicesprofilepath (in user parameters)

I am having trouble getting both.

For example, for msexchmailboxsecuritydescriptor, if I have code similar to the following:

DirectoryEntry deresult = result.GetDirectoryEntry();
byte[] bteMailACL =(byte[])deresult.Properties["msexchmailboxsecuritydescriptor"].Value; 

He complains that I cannot use System .__ ComObject for System.Byte [], but I saw several examples that use code similar to the one above.

How do I understand these drops of information?

+3
source share
1 answer

, .Value . , , , , AD, , 0 .

:

    byte[] btwMailACL = (byte[])deresult.Properties["msexchmailboxsecuritydescriptor"][0];

.

: , NullReferenceException, , .

( , )

+5

All Articles