How to filter Active Directory using objectGUID ?

G

Guest

Hello !

I want to do something like this:
string strFilter = "SyntaxThatICantFound";
DirectoryEntry dreAD = new DirectoryEntry("LDAP://192.168.0.1", "Admin",
"Admin");
DirectorySearcher drsAD = new DirectorySearcher(dreAD);
drsAD.Filter = "objectGUID=" + strFilter;
drsAD.FindOne().GetDirectoryEntry();
But I can't found the syntax for the string strFilter, indeed in Active
Directory objectGUID is a Byte[] and the drsAD.Filter take a string.
I have try "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" and
"XX-XX-XX-XX-XX-XX-XX-XX-XX-XX-XX-XX-XX-XX-XX-XX" with no result.
Someone have a solution ?
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top