AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones LDAP
  • Overview
  • Retrieving information about the users
  • 1. Connecting to the server that contains the Active Directory
  • 2. Finding users
  • 3. Close the session
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
An LDAP directory is used to share information databases on a local or external network. This information directory can contain all kinds of information, personal details of persons or system data.
Active Directory is a standardized LDAP directory.
An Active Directory lists network properties, user accounts, computers and more. It is often used to identify users.
This help page explains how to retrieve information about the users stored in an LDAP directory.
Retrieving information about the users

1. Connecting to the server that contains the Active Directory

LDAP is based on a Client/Server architecture. Therefore, you must connect to the server that contains the Active Directory.
The connection requires the address of the server, the name of the user as well as his password.
These parameters are filled in the LDAPSession structure:
  • LDAPSession.Host for the server address.
  • LDAPSession.User for the username.
  • LDAPSession.Password for the password.
The connection is established by LDAPConnect.
// Fill the connection structure
LDAPSession.Host = EDT_SERVER
LDAPSession.User = EDT_USER
LDAPSession.Password =  EDT_PWD
// Connection to the LDAP server
LDAPConnect("MySession")
Remarks:
  • LDAPConnect uses the parameter filled in the LDAPSession structure. Then, all you have to do is pass as parameter the name that will be given to the session. Several sessions can be opened at the same time, under different names.
  • LDAPReset is used to reinitialize all the variables of the LDAPSession structure.
  • SSL-secured LDAP: The LDAPSession structure can also be used to manage an SSL-secured connection via the LDAPSession.Option variable. For more details, see LDAPSession structure.

2. Finding users

LDAP is an information database. This information database is organized in a tree-like structure. It is made of elements that can themselves contain other elements. Each element has properties. Each element is identified via a unique name (Distinguished Name).
LDAPListChildren is used to list the element children (which means the elements found in this element).
To retrieve the elements of the Users DN (that contains all the users), the following parameters must be passed as parameter to LDAPListChildren:
  • The connection name (defined by LDAPConnect),
  • The DN of the Users element. For an Active Directory, the DN for retrieving the users will always be the same.
LDAPListChildren returns a string. This string contains the identifiers of all the children found separated by CR characters (Carriage Return).
Therefore, all you have to do is browse the returned string to retrieve each child one by one. Then, LDAPValue lets you retrieve the value of an element's property, that is:
  • the username (Name property),
  • the description (Description property),
  • the Administrator property (AdminCount property).
// List the users
sListChildren = LDAPListChildren("MySession", "CN=Users,DC=tdf, DC=local")
// For all the users found
FOR EACH STRING sChild OF sChildrenList SEPARATED BY CR
	// Retrieve the properties of this user (name, description, administrator)
	sName = LDAPValue("MySession", sAChild, "name")
	sDescription = LDAPValue("MySession", sAChild, "description")
	bAdministrator = LDAPValue("MySession", sAChild, "adminCount")
END
Please note Depending on the LDAP strategies defined in Active Directory, import may be limited to 1,000 users. In this case, to remove this limitation, it is necessary to modify the LDAP MaxPageSize parameter. For more details, see https://support.microsoft.com/kb/315071.

3. Close the session

LDAPDisconnect is used to end the LDAP session.
// Disconnection
LDAPDisconnect("MySession")
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local