Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 06, 2013 07:47 AM by mayankkarki
Nov 19, 2012 05:57 AM|LINK
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.
Please help its urgent.
Nov 26, 2012 12:58 AM|LINK
I notice that you have post the same thread in .NET Framework Forums, glad that you've solved your problem by yourself.
if someone is interested in this problem, please refer the solution
Jun 06, 2013 07:47 AM|LINK
ActiveDs.ADsSecurityUtility secUtility = new ActiveDs.ADsSecurityUtility(); ActiveDs.IADsSecurityDescriptor sd = (IADsSecurityDescriptor)secUtility.ConvertSecurityDescriptor((byte)attribute, (int)ADS_SD_FORMAT_ENUM.ADS_SD_FORMAT_RAW, (int)ADS_SD_FORMAT_ENUM.ADS_SD_FORMAT_IID);