I would like in c# get a user or a group using objectSID ref.
sample:
******
DirectoryEntry de = Utility.GetDirectoryObject();
DirectorySearcher deSearch = new DirectorySearcher();
deSearch.SearchRoot = de;
deSearch.Filter = "(&(objectClass=group)(objectSid=" + SID + "))";
SearchResult result = deSearch.FindOne();
My problem :
**********
I have a SID value in byte[] type. What sort of string value I have to put
in my filter and how to obtain it?
Thanks a lot
SD
Basically, a binary LDAP filter is constructed by taking each byte and
converting it to a hex character pair, preceding each byte with a "\". You
can use the .NET "X2" format string do this.
There is a function in the code samples from the book called
BuildFilterOctetString which you can download from the site above that
demonstrates this.
Joe K.
"SD" <raspou...@hotmail.com> wrote in message
news:ur$WjTPeG...@TK2MSFTNGP05.phx.gbl...
Cdt,
SD
"Joe Kaplan (MVP - ADSI)" <joseph....@removethis.accenture.com> a écrit
dans le message de news: uk5IMkPe...@TK2MSFTNGP02.phx.gbl...
"Joe Kaplan (MVP - ADSI)" <joseph....@removethis.accenture.com> a écrit
dans le message de news: uk5IMkPe...@TK2MSFTNGP02.phx.gbl...
--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net
---O'Reilly Active Directory Third Edition now available---
http://www.joeware.net/win/ad3e.htm