title: How do I do an LDAP query with JavaScript?
body: <p>I'm trying to make a sidebar gadget that has an LDAP query function but haven't been able to find very good, or any, useful documentation on the matter. I'm not hugely experienced with Javascript and know little to nothing about how LDAP queries function, so any information at all would be useful.</p>
  
  <p>info:</p>
  
  <ul>
  <li>host: a.b.c.d.e</li>
  <li>port: 389</li>
  <li>ou: people</li>
  <li>o: x_y_z</li>
  <li>c: us</li>
  </ul>
  
  <p>first snippet:</p>
  
  <pre><code>var sSearchURL = "ldap://a.b.c.d.e:389/o=x_y_z,c=us";
  var URLsuffix = "dc=" + form.SearchData.value;
  document.location = sSearchURL URLsuffix;
  </code></pre>
  
  <p>other snippet:</p>
  
  <pre><code>var ldap = GetObject('LDAP:');
  var ad = ldap.OpenDSObject(
    'LDAP://a.b.c.d.e:389/o=x_y_z',
    'cn=Administrator,ou=People,o=rootname',
    'password',
    0
  );
  </code></pre>