Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 2 Monaten
Letzter Beitrag:
vor 5 Jahren, 2 Monaten
Beteiligte Autoren:
kimor, Paulo Oliveira, Al

LDAP Search [WD 18] or below

Startbeitrag von kimor am 20.05.2013 08:56


I need to search the AD with LDAP for users (one at the time).
I want to search with the function NetWorkUser and find e-mail and full name for the user.
The domain users are located at:
CN=Domain Users,CN=Users,DC=linkon,DC=local

How would that look?

To get started I got this down so far:
gsLDAPSession is string="LDAPSession" //in global declaration

LDAPSession.User = "xxxxxxxxx"
LDAPSession.Password = "xxxxxxx"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.Host = "xxxxxx"
IF LDAPConnect(gsLDAPSession) THEN Info("Connected with LDAP")

// Search for information about the user.
sDn is string = LDAPFind("gsLDAPSession", "CN=Domain Users,CN=Users,DC=linkon,DC=local","sAMAccountName=s052wp") //This line is wrong...Maybe I should use LDAPSearch?




did you try the get the value of the attribute?
What is the error?

Info(LDAPValue(gsLDAPSession,"CN="+NetworkUser()+",CN=Domain Users,CN=Users,DC=linkon,DC=local","mail"))

von Paulo Oliveira - am 20.05.2013 09:55
Hi Paulo,
Thanks for the answer.
I havn't got an error yet, I just didn't know how to write the line.

I'll try this later and hope it works! :-)


von kimor - am 20.05.2013 10:03
Hello Kim

Have a look at the user groupware programs. They access the AD as part of their process so you should find some useful examples in that code and there is also a dotnet AD example that may offer some ideas.
C:\WinDev 18\Programs\Data\Models\GPW\WD


von Al - am 20.05.2013 10:06
Hi Paulo (and others)

Unfortunally the line:
Info(LDAPValue(gsLDAPSession,"CN="+NetworkUser()+",CN=Domain Users,CN=Users,DC=linkon,DC=local","mail")
came up empty

Any ideas?


von kimor - am 20.05.2013 19:46
I don't know if mail is the attribute to use (that was only one example), try to list all the attributes of the user to see what you can use.

Info(LDAPListAttribute(gsLDAPSession,"CN="+NetworkUser()+",CN=Domain Users,CN=Users,DC=linkon,DC=local"))

von Paulo Oliveira - am 21.05.2013 08:37
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.