Loading TOC...

MarkLogic 9 Product Documentation
xdmp.ldapSearch

xdmp.ldapSearch(
   query as String,
   [options as Object?]
) as Sequence

Summary

Returns ldap search result. The function returns a Sequence containing objects, where each object is an ldap attribute with its value.

Parameters
query The query is a string representation of the filter to apply in the search. The string should conform to the format specified in RFC 4515 as extended by RFC 4526. For example, "(cn=Jane Doe)".
options Options with which to customize this operation. This function supports the following options:
"username"
ldap username.
"password"
ldap password.
"serverUri"
ldap server uri.
"searchBase"
search-base is the DN of the entry at which to start the search.
"useAppserverConfig"
Use appserver config as default. Specify true or false. The default is false.
"bindMethod"
ldap bind method. Specify simple, MD5 or external. The default is MD5.
"credentialId"
The credential to be used to sign the generated certificate.
"startTls"
start tls (Transport Layer Security) extended operation. Specify true or false. The default is false.
"certificate"
client certificate.
"privateKey"
private key for the client certificate.

Example

xdmp.ldapSearch(
  "(cn=Jane Doe)",
  {"username":"admin",
   "password": "password",
   "serverUri":"ldap://dc1.mltest1.local:389",
   "searchBase":"CN=Users,DC=MLTEST1,DC=LOCAL"})

=> (Sequence of ldap attributes)
{"DN":"CN=TestUser 1,CN=Users,DC=MLTEST1,DC=LOCAL"}
{"objectClass":"top"}
{"objectClass":"person"}
{"objectClass":"organizationalPerson"}
{"objectClass":"user"}
{"cn":"TestUser 1"}
{"sn":"1"}
{"givenName":"TestUser"}
{"distinguishedName":"CN=TestUser 1,CN=Users,DC=MLTEST1,DC=LOCAL"}
{"instanceType":"4"}
{"whenCreated":"20120403202513.0Z"}
{"whenChanged":"20141110215113.0Z"}
{"displayName":"TestUser 1"}
{"uSNCreated":"16424"}
{"memberOf":"CN=TestGroup Admin,CN=Users,DC=MLTEST1,DC=LOCAL"}
{"memberOf":"CN=Domain Admins,CN=Users,DC=MLTEST1,DC=LOCAL"}
{"memberOf":"CN=Enterprise Admins,CN=Users,DC=MLTEST1,DC=LOCAL"}
{"uSNChanged":"821482"}
{"name":"TestUser 1"}
{"userAccountControl":"66048"}
{"badPwdCount":"0"}
{"codePage":"0"}
{"countryCode":"0"}
{"badPasswordTime":"130603927417675781"}
{"lastLogoff":"0"}
{"lastLogon":"130604945508720703"}
{"pwdLastSet":"129779583138125000"}
{"primaryGroupID":"513"}
{"adminCount":"1"}
{"accountExpires":"9223372036854775807"}
{"logonCount":"384"}
{"sAMAccountName":"test1"}
{"sAMAccountType":"805306368"}
{"userPrincipalName":"test1@MLTEST1.LOCAL"}
{"objectCategory":"CN=Person,CN=Schema,CN=Configuration,DC=MLTEST1,DC=LOCAL"}
{"dSCorePropagationData":"20120403203538.0Z"}
{"dSCorePropagationData":"16010101000000.0Z"}
{"lastLogonTimestamp":"130601298735058594"}

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.