The objectSid attribute is binary-valued, so to search on it, you have to
use the binary value of the SID. Binary values are represented in LDAP
search filters as \xx, where "xx" are two hexadecimal digits. The details
of LDAP search filters are covered in RFC 2254 (available at
http://www.ietf.org/rfc/rfc2254.txt).
For example, suppose your SID in string form was
S-1-5-21-2562418665-3218585558-1813906818-1576. In binary form, this is
{01,05,00,00,00,00,00,05,15,00,00,00,e9,67,bb,98,d6,b7,d7,bf,82,05,1e,6c,28,06,00,00},
so the LDAP search filter would be:
(objectSid=\01\05\00\00\00\00\00\05\15\00\00\00\e9\67\bb\98\d6\b7\d7\bf\82\05\1e\6c\28\06\00\00)
Thanks,
Matthew Rimer [MSFT]
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"CobolExpert" <(E-Mail Removed)> wrote in message
news:CE0BD837-F3E2-4406-B717-(E-Mail Removed)...
> Hi,
> I am having a bit of trouble finding a SID in AD.
>
> In AD, I go to Find, Custom Search and enter this in as my LDAP query -
>
> (&(ObjectSid=S-1-2-3-4-5-6-7-8))
>
> I get nothing back even though I know the sid exists. Could someone tell
> me
> what I am doing incorrectly?
>
> Thanks.