Service Desk Practitioners Forum
cancel

LDAP Extractor 0.97

Highlighted
Radovan Skolnik
Acclaimed Contributor.

LDAP Extractor 0.97

Hello!

Here's my updated LDAP extractor. Added few things, fixed few bugs, updated docs on how to handle some situations (missing values).

Hope you like it. Please I need feedback on this - if you use it (or can't use for any reason), please let me know about it.

Best regards

Radovan Skolnik
45 REPLIES
Jasper Verweij
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Radovan,

thank you very much, I haven't had a customer recently asking for this functionality, otherwise I would have used it for sure.

Jasper
Guenther Schere
Honored Contributor.

Re: LDAP Extractor 0.97

Hi Radovan,

the possibility to use is very powerfull. After a few mistakes of me it works very good.
All important things are mentioned in your readme.htm or example.xml.
Great tool.

With "debug=â falseâ " the logs are smaller.

Thank you
Gu
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Thanx for feedback Gunter. Please everybody else, if you miss some feature, have some problems, please let me know. I'll do my best...

Radovan Skolnik
Christine Perry
Super Contributor.

Re: LDAP Extractor 0.97

Radovan - I have not yet tried your LDAP tool. Is there any conflict with the std data extract used by SD? In other words, if I try this and choose not to use it does the std SD data extract still function?
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

No, no... My application is not a replacement - it is another way to do things. It doesn't replace anything - it is completely standalone - it's just that the outpu it produces is in the same format Data Exchange would produce. So you do not have to worry - if anything went wrong you just switch back to usual Data Exchange.

Please test it - I'm sure you'll enjoy it :-) If you have any questions - do not hesitate to ask here or contact me directly.

Best regards

Radovan Skolnik
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Here's attached newer version (0.98) that adds support for specifying timestamp formats - both for those coming from LDAP (some people were having different format - there's example in readme that should work for those) and for outputing to XML )so that SD recognizes it). Also some bug related to unrecognized timestamp formats was fixed (unrecognized format caused java.lang.NullPointerException and the program halted). Please test and enjoy!
Jasper Verweij
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Radovan,

I have discovered lately ANT (http://ant.apache.org) and I'm planning to create ANT implementation for sd_export and sd_import (one of I would like to add is to make a ANT task to make a certain value in XML sd searchcode compatible (uppercase, removes spaces and other characters). Another wish is to create a better import reporting logfile to show me only the errors and warnings in one logfile (in stead of two logfiles, scanning manually this logfile).

Are you planning to make your LDAP extractor ANT compatible?

Jasper
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Jasper, AFAIK the Ant is an alternative to make command (so it allows you to define tasks, their dependencies, ...). I cannot clearly imagine what use could that be (at least not with Ant only). Could you please describe the scenario further, maybe provide some examples of propsed use? If I find it usable I can do some changes to make it 'Ant compatible'.

Radovan
Jasper Verweij
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Radovan,

I have used your tool yesterday for the first time. After having troubles with date (I didn't use latest version...) I was able to create a simple setup for customer within a few edited lines!

As told before I have discovered lately ANT. To me ant build scripts are easier to understand than creating batch scripts. In theory ANT scripts aren't OS specific as well. Creating log info and send this info to persons is easier as well.

It isn't a must to have ANT-integration with your LDAP tool (I can launch Jar file from ant as well), but it will make my idea of creating ANT support for data exchange stronger ;-)

Jasper

Jasper
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Jasper - I'll check out Ant once more. In the meantime could you send me (to e-mail would be OK) how you imagine the integration of log file should look like? What would be needed? I'm willing to improve my tool - version 1.0 could be the one with Ant integration...

Radovan Skolnik
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Hi Radovan,

I have tried your extractor with no success.

I can get the extractor to run, and the XML is created, and in the log file, there are no errors, but it says that 0 entries written.

The reason i tried it, is cause within the LDAP.ini file, I am unable to write the functions to concatenate the GivenName and the Surname to form the Searchcode for the Persons.

I attempted to use your extractor, and configure the same, but also with no luck.

Attached is the XML and log file.

If you are able to help, I will appreciate it alot.

Thanks
SHaun
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Hi,

Attached is the INI file from within Data Exchange to achieve a similar result.

Reards
Shaun
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Shaun,

from what I see in the config file it is exactly the same file that I include with proggie as example. Two things:

1. Check out (send me a screenshot) what some LDAP browser returns at given searchBase. Are there any records with "objectclass=organizationalUnit"?
2. For person records (beware - these are looked for inside found Organizations!) you left an example filter there that only allows Persosns with names Petra or Lucia!

Looking at you .ini file you probably only want to extract Persons and not Organizations. In that case your .xml configuration is wrong because it first recursively searches for Organizations and inside them (below in LDAP tree) searches for Persons. To fix it you need to remove top-most with its so that directly below you'll have .

Hop it helps.

Radovan
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Hi Radovan,

I edited the example to include and exclude what was necessary for my requirement, but still to no success.

My question would be, can I use functions or statements in the config file in your tool to create a searchcode from the LDAP extract, for importing into the application?

Regards
Shaun
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Shaun, what you want to achieve is exactly what is my tool intended for. Just seems you cannot get it work right. I changed your .xml config according to your .ini file (not all but what is most important). Get it attached here. Hope it helps.

Radovan
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Hi Radovan,

The config file workds fine thanks, I need one more thing please, if you dont mind, the Searchcode if would like is the 1st letter from the GivenName + 1st letter from the SN + EmployeeCode.

What would the string look like in order to achieve this?

Thanks
Shaun
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Radovan,

If I am correct it should look something like "(givenName.substring(0,1) + sn.substring(0,1) + sAMAccountName).toUpperCase()"

Is this correct?

Shaun
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Radovan,

Also, could you help me with the string to limit the search, that if the EmployeeID (SamAccountName) is empty, to not import the entries.

Thanks
SHaun
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

The concatenation of strings should work as you indicated.

Regarding checking for some value: this should be specified in searchFilter. However I don't know imediately how to specify search for non-empty values. Try looking into the LDAP RFCs indicated in the readme for the tool.

Radovan
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Radovan,

Thanks for all your help.

If I find out how it is done to restrict the search to exclude NULL values, I will add it here.

Thanks once again
Shaun
Wilfried Riegel
Respected Contributor.

Re: LDAP Extractor 0.97

Hi Shaun,
some examples for conditions:
CONDITION=(!(SN=*) -- all without NULL
CONDITION=(&(SN=*) (objectclass=user)) --SN not null and only users
CONDITION=(&(SN=*) (mail=*)) -- all where neither SN nor mail is null
CONDITION=(SN=) --all with SN is null

Regards
Wilfried
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Thanx Wilfried for info (I am too busy and lazy to check out the RFC :-)

Radovan
Shaun Oelofsen
Honored Contributor.

Re: LDAP Extractor 0.97

Hi Will,

Thank you for the information. I read the RFC, and tried every combination possible.











If there are any entries that are incorrect, I would appreciate any help.

Thanks
Shaun
Radovan Skolnik
Acclaimed Contributor.

Re: LDAP Extractor 0.97

Shaun, you should read the docs more carefully :-) There's no such thing as CONDITION in DIRECT. What was pointed out by Wilfried is to use it in ENTRY_CLASS's searchFilter. So your desired configuration should look like this probably:












Hope it works.

Radovan