<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.ldapSearch.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.ldapSearch</api:function-name><api:suggest>xdmp.ldapsearch</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>ldapsearch</api:suggest><api:function-link mode="xquery" fullname="xdmp:ldap-search">/apidoc/8.0/xdmp:ldap-search.xml</api:function-link><api:function mode="javascript" name="ldapSearch" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.ldapSearch"><api:summary>
  Returns ldap search result.  <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">The function
  returns a ValueIterator containing objects, where each object is 
  an ldap attribute with its value.</span>
</api:summary><api:params><api:param name="query" type="xs:string"><api:param-description>
    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)".
  </api:param-description><api:param-name>query</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="options" type="(element()|map:map)?" optional="true"><api:param-description>
    The options for ldap search.
    

    <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">
    <p>Options include:</p>
    <dl>
    <dt>username</dt>
    <dd>ldap username.</dd>
    <dt>password</dt>
    <dd>ldap password.</dd>
    <dt>serverUri</dt>
    <dd>ldap server uri.</dd>
    <dt>searchBase</dt>
    <dd>searchBase is the DN of the entry at which to start the search.</dd>
    <dt>useAppserverConfig</dt>
    <dd>use appserver config as default.</dd>
    </dl>
    </span>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>Object?</api:param-type></api:param></api:params><api:return class="javascript">ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.ldapSearch(
  "(cn=Jane Doe)",
  {"username":"admin",
   "password": "password",
   "serverUri":"ldap://dc1.mltest1.local:389",
   "searchBase":"CN=Users,DC=MLTEST1,DC=LOCAL"})

=&gt; (ValueIterator 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"}
</pre>
</api:example></api:function></api:function-page>