You can connect a custom SharePoint list (no Web part) directly with external data from Active Directory to access users or devices using the
SharePoint Business Data List Connector (BDLC).
You can set the connection string, the select statement and the primary keys (if any) simply in the SharePoint list settings dialog. Here are some sample connection strings and select statements of the OLE DB provider 'ADSDSOObject' for Active Directory access.
Connection String
Provider=ADSDSOOBject; User Id=Mydomain\myUser; Password=myPwd; Mode=Read; Bind Flags=0; Page Size=1000;
Start with an high privileged user account. If no account is given, the access rights of the currently logged in user are used if accessing the data manually in the list settings. Just be sure to not run into a double hop problem in this case. For updating data in background the access rights of the respective service account are used.
Select Statement
Example:
SELECT givenName, name, title, telephoneNumber From 'LDAP://DC=Yourdomin, DC=COM' WHERE objectClass='user' AND objectCategory='Person'
Known issues & workarounds
In some cases the preview feature does not work as expected. But you can create a SharePoint list structure and update the data as usual with BDLC, if the connection string and the select statement have passed the verification without any errors.
In some cases it could be helpfull to directly adress the domain server, e.g.
SELECT name, ADsPath From 'LDAP://mydomainserver.mydomain.lokal/DC=Layer2,DC=LOKAL' WHERE objectClass='user' AND objectCategory='Person'
For large data sets setting page size in connection string is helpful.