| Store | Cart

Re: Getting Active Directory objectsid value using Net::LDAP - Help!

From: Carl Jolley <cjol...@iac.net>
Tue, 26 Mar 2002 14:12:40 -0500 (EST)
On Mon, 25 Mar 2002, Ray Cordoni wrote:

> I am using Net::LDAP to get user information from our Active Directory.> I am testing this with ActiveState perl but will be porting to run on a> Unix system.  As far as I have found, Net::LDAP is the only way I can> get information out of Active Directory from a Unix system.>> The problem I have is I don't know how to decode objectsid from binary> into its string value.  I need objectsid for my application because it> is a unique key for each user and stays the same even if the user's name> changes.  The Microsoft MSDN site says that objectsid is in a binary> format called octetstring and offers up a complicated looking C++> program that relies on a Microsoft API call to translate it.>> Does anybody know how to translate the value of objectsid using just> straight perl and no Win32 specific stuff?>

I don't have a clue about decoding objectsid or LDAP but an octetstring
simply means that the data is in the form eight-bit characters. How those
characters _may_ be encoded is an another question all together. Binary
characters which are not encrypted are quite often encoded as Mime Base64
data or uuencoded data. These methods, both of which perl can easily
handle without any Win32 specific stuff, are often used so that 8 bit
characters can be transmitted in data streams that utilize ASCII (7-bit)
characters. Both of these encoding schemes use 6 bits of 4 ASCII
characters to hold the values of all 24 bits of three 8-bit characters.
The key to your problem is to determine how the octetstring is encoded.
You may be able to figure this out by information provided by MS
about the C++ program (or the API it uses) which does the decoding.

**** cjol...@iac.net <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

Recent Messages in this Thread
Ray Cordoni Mar 26, 2002 05:25 am
Carl Jolley Mar 26, 2002 07:12 pm
c. church Mar 26, 2002 08:07 pm
Messages in this thread