If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > openLDAP via VBScript.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-03-10, 16:57
Tom_T Tom_T is offline
Registered User
 
Join Date: Nov 2010
Posts: 2
openLDAP via VBScript.

Hope I've posted this in the right area and that you can help me

Hi

I'm trying to extract data from an LDAP database.

I can connect fine, and pull some information using this code:

Code:
Set ado = CreateObject("ADODB.Connection")
ado.Provider = "ADSDSOObject"
ado.Properties("User ID") = "username"
ado.Properties("Password") = "password"
ado.Properties("Encrypt Password") = False
ado.Open "ADS-Anon-Search"

serverName = "10.10.10.1/cn=Units"
filterStr = "(&(objectclass=unit)(serialnumber=*123456*))"

Set objectList = ado.Execute("<LDAP://" & serverName & ">;" & filterStr & ";ADsPath;SubTree")

While Not objectList.EOF
    WScript.Echo objectList.Fields(0).Value
    objectList.MoveNext
Wend
The above returns a list of all live units which match the serial number.
What I can't seem to do is get any further information from the LDAP 'UNIT \cn=Units'

I know each Unit in cn=Units, also has:

ipaddress
cn
name
id
location
password
status

I have tried to edit ";ADsPath;SubTree" to ";ADsPath,name, id,location;SubTree"
But this returns an error..

I have used PHP to get this information, so I know it's there..

So how do I get it using VBS ??

Thanks for your time.
Reply With Quote
  #2 (permalink)  
Old 11-03-10, 16:58
Tom_T Tom_T is offline
Registered User
 
Join Date: Nov 2010
Posts: 2
Quick update. Changing to this allows me to pull some more information.
Code:
Set objectList = ado.Execute("<LDAP://" & serverName & ">;" & filterStr & ";cn,description,objectclass,telephonenumber", ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
BUT as soon as I try to get anything else I get errors.
eg:
Code:
";cn,id,description,objectclass,telephonenumber"
Anyone any ideas ? As mentioned PHP works fine !
Reply With Quote
  #3 (permalink)  
Old 12-03-10, 10:48
MoNarjis MoNarjis is offline
Registered User
 
Join Date: Dec 2010
Posts: 1
Question Ldap password

Hi All,

I have an Open Ldap server with customer login information and Pasword. Is there a way to read this password when a customer forgets his password?

LDAP use SHA Hash.

It must be possible because Softera Ldap Browser can read the password. My website is in ASP.


I hope someone have a solution.
Thanks,

Mo
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On