Reputation: 29
I'm using LDAP Administrator 2013.1 and I'm looking for an Object GUID.
ObjectGUID
is {824582FD-5728-4C54-B699-D701D9D48196}
There's an option to perform an LDAP SQL query
Seems simple enough but I can't get it to work.
My query is:
SELECT $name
FROM "OU=Workstations,OU=Vista,DC=lab,DC=local"
WHERE $currentValue = '{824582FD-5728-4C54-B699-D701D9D48196}' PAGESIZE 2
I'm trying to output the name of ObjectGUID
{824582FD-5728-4C54-B699-D701D9D48196}
I know that it is there because I looked it up manually...
Thanks in advance for your help.
Upvotes: 1
Views: 4447
Reputation: 546
ObjectGUID is a special binary type so it cannot be queried using the string representation directly as you are attempting.
Here's a post from Joe Kaplan on a different forum that describes how to do this:
...the filter string would look like this:
(objectGUID=\BA\EF\9F\88\DD\E8\5E\46\9B\F8\0E\0C\4 1\12\9D\40)
For this GUID:
889FEFBA-E8DD-465E-9BF8-0E0C41129D40
Essentially, you need to take the COM string GUID that you have, convert it to a binary GUID and then convert that binary data to an octet string with each binary byte prefixed by a \ as shown above.
If you need help with doing that, there is a small .NET utility posted on the files section of www.directoryprogramming.net called GUIDConverter that does these conversions for you.
So the only part you're missing is converting the string representation of the GUID to binary and formatting the query correctly. The byte array sequence is:
[3] [2] [1] [0] - [5] [4] - [7] [6] - [8] [9] - [10] [11] [12] [13] [14] [15]
Upvotes: 8