I want to make a query against a LDAP directory of how employees are distributed in departments and groups...
Something like: "Give me the department name of all the members of a group" and then use R to make a frequency analysis, but I can not find any examples on how to connect and run a LDAP query using R.
RCurl seems to have some kind of support ( http://cran.r-project.org/web/packages/RCurl/index.html ):
Additionally, the underlying implementation is robust and extensive, supporting FTP/FTPS/TFTP (uploads and downloads), SSL/HTTPS, telnet, dict, ldap, and also supports cookies, redirects, authentication, etc.
But I am no expert in R and have not been able to find a single example using RCurl (or any other R library) to do this..
Right now I am using CURL like this to obtain the members of a group:
curl "ldap://ldap.replaceme.com/o=replaceme.com?memberuid?sub?(cn=group-name)"
Anyone here knows how to do the same in R with RCurl?
curl -u USERNAME 'ldap://192.168.0.66/CN=Users,DC=training,DC=local\?sAMAccountName?sub?(ObjectClass=*)'
(that's from an IBM example). It won't work for you since you need to know the proper search parameters. It's pretty straightforward to run that viaRCurl
and then process the results, but if you should get the query working fromcurl
on the command line first. – Archivistldapsearch -t -h ldap.replaceme.com -x -b "o=replaceme.com" "(cn=group-name)" memberuid
– Braswellldapsearch
tocurl
and then toR
withRCurl
, that would be the exact answer I am looking for... – Braswell