I am working on a website to manage active directory. I want to check that whether user has permission to change password or not. So I have to find "ntSecurityDescriptor" property value after that I have to cast it into IADsSecurityDescriptor.
Now if I use DirectorySearcher class then property value is of type System._ComObject and easily casted to IADsSecurityDescriptor. But when I use LdapConnection and SearchResponse I get property value of type.
byte[] array which is unale to cast to IADsSecityDescriptor.
I am getting error
Unable to cast System.Byte[] to IADsSecurityDescriptor
Is there some problem with SearchResponse or I have use some kind of casting technique to achieve this? I have some problem to use DirectoryEntry class so I can only use LdapConnction class.