title: Getting AD Details based on username
body: <p>I have a code to retrieve the details of a user from the AD such as email address, phone number etc, etc. The codes I am currently using is:</p>
  
  <pre><code>Set objSysInfo = CreateObject("ADSystemInfo")
  strUser = objSysInfo.UserName
  msgbox(strUser)
  Set objUser = GetObject("LDAP://" &amp; strUser)
  </code></pre>
  
  <p>It gets the currently logged in user's details. But what I need to do now is to parse in the user's username and retrieve the details based on that.</p>
  
  <p>I have tried to change objSysinfo.UserName to the username and it returned blank.</p>
  
  <pre><code>Set objSysInfo = CreateObject("ADSystemInfo")
  strUser = "SomeUserName"
  msgbox(strUser)
  Set objUser = GetObject("LDAP://" &amp; strUser)
  </code></pre>
  
  <p>How should I go about retrieving the details from the AD based on a user name provided?</p>