title: VBScript LDAP: Is there a way to query for physicalDeliveryOfficeName using the email address in Active Directory?
body: <p>I'm attempting to utilize <a href="http://en.wikipedia.org/wiki/VBScript" rel="nofollow noreferrer">VBScript</a> to connect pull the <code>physicalDeliveryOfficeName</code> attribute in <a href="http://en.wikipedia.org/wiki/Active_Directory" rel="nofollow noreferrer">Active Directory</a> by providing the email address.  </p>
  
  <p>I know how to do it with a common name like the following:</p>
  
  <pre><code>Set MyUser = GetObject ("LDAP://cn=" &amp; uname &amp; ",ou=" &amp; strname &amp; ",DC=bobdom,DC=net")
  </code></pre>
  
  <p>However only the email address is available.  How to do this? I've even tried </p>
  
  <pre><code>Set MyUser = GetObject ("LDAP://mail=" &amp; uname &amp; ",ou=" &amp; strname &amp; ",DC=bobdom,DC=net")
  </code></pre>
  
  <p>and that doesn't work.  </p>