Hi, 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. Thanks.
mayankkarki
0 Points
2 Posts
Property value returned by DirectorySearcher and SearchResponse are of different type System._com...
Nov 19, 2012 05:57 AM|LINK
Hi,
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.
Thanks.
Angie xu - M...
All-Star
20267 Points
1726 Posts
Microsoft
Re: Property value returned by DirectorySearcher and SearchResponse are of different type System....
Nov 26, 2012 12:58 AM|LINK
Hi mayankkarki
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 here.
Kind regards
Feedback to us
Develop and promote your apps in Windows Store
mayankkarki
0 Points
2 Posts
Re: Property value returned by DirectorySearcher and SearchResponse are of different type System....
Jun 06, 2013 07:47 AM|LINK