Reading - Parsing Records From An LDAP LDIF File In .Net?

J

jeangv

Reading - Parsing Records From An LDAP LDIF File In .Net?

I am in need of a .Net class that will allow for the parsing of a LDAP
LDIF file. An LDIF file is the standard format for representing LDAP
objects. I need to be able to read the records from an LDIF file into
..Net.

There exists a Perl module that will do exactly this called
Net::LDAP::LDIF but I am wanting to port my code over to .Net and
cannot find anything with similar LDIF functionality. I would like to
avoid having to write my own .Net class to read the LDIF file and
create record objects. I am sure I am not that only person that needs
to do this that is using .Net.

Does there exist a .Net class that will read LDIF files? Is there a
third party .Net class that can be purchased that can read an LDIF
file?

Any help would be appreciated,
Jean-Marie Vaneskahian
(e-mail address removed)
 
J

Joe Kaplan \(MVP - ADSI\)

I have not seen such a library anywhere.

Just out of curiosity, what do you need this for? Are you planning to read
the LDIF files and do LDAP operations programmatically? It sounds a little
like you are reinventing LDIFDE.exe...

Joe K.
 
J

jeangv

Joe,

First and foremost I want to thank you very much for all your
contribution to the message boards on Active Directory access via .Net.
I also love your new book "The .NET Developer's Guide to Directory
Services Programming".

Your assessment is basically correct. My goal is to read the records
from an LDIF file then programmatically process them. The source of
the LDIF file however is NOT the Active Directory.

I work for a HUGE multi-national company that uses a massive X.500
directory for mastering all object information. I get a very large
daily LDIF file with the objects exported from the X.500.

Today I use Perl to parse the LDIF file and read each entry as a
record. I then use the OLE interface in Perl to set the global Active
Directory account data to match what was in the X.500 LDIF data after
some modification.

To move this process off of Perl and use .Net I would need two parts.
The ability to read an LDIF file and the ability to manipulate Active
Directory objects. Your book makes the second of the two tasks easy,
but the first is very important.

If no such library that can read an LDIF file exists, what would it
take to write a .Net class that can do that?

1 - Understand how LDIF files are formatted based on the RFC

2 - Know how to convert some LDIF fields from Base64

3 - Know how to construct a LDAP type object populated with the fields
and values from the LDIF object that was read.

This all sounds a bit too complex for me. Especially since I am not
sure how to pass a object with these unknown parameters back and
fourth. The Perl module that I used today, makes all this trivial.
Here is the link to Net::LDAP::LDIF

http://search.cpan.org/~gbarr/perl-ldap/lib/Net/LDAP/LDIF.pod

Any guidance at all would be greatly appreciated. My goal in moving
from Perl way to keep all my code in .Net if possible. I do miss the
access to all the readily available and very diverse Perl modules in
the move to .Net

Thanks for any help,
Jean-Marie Vaneskahian
(e-mail address removed)
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top