views:

34

answers:

2

I have the LDAP server hostname and the search base, but have not been able to find any way of using that information with javascript. this is to be used in a windows sidebar gadget.

A: 

There is an example in this article that I used from Lothar Haeger's Password Notifier driver for Novell Identity Manager. He has an ECMA implementation of LDAP Search. That is basically what you are looking for, right? In the first link the code is in the article. In the second link, you would have to pick apart the driver XML to get the ECMA out.

geoffc
A: 

Have you tried using LDAP via ActiveX? Something along the lines of:

var ldap = GetObject('LDAP:');
var ad = ldap.OpenDSObject('LDAP://servername:port/o=rootname', 
    'cn=Administrator,ou=Members,o=rootname', 'password', 0);

I adapted this code from the sample on MSDN here: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q328024

The sample is in VBScript but it shouldn't be too tricky to change it to JScript.

Jani Hartikainen
how would i go about using that in a gadget to call or gather information such as a phone number? the vbscript one would be fine if it works
Jake
You should be able to query the LDAP the server for the user account details. I can't remember the exact specifics, but you should find more samples at least in VBScript or PHP which should be applicable to JS with some minor changes.
Jani Hartikainen