title: Active Directory Query returning empty fields where it shouldn't
body: <p>I've been facing this problem and it doeen't seems to have an end, hope you can help me.</p>
  
  <p>I'm making an LDAP query against Active Directory within a Powershell script. Getting right to the point this is my code: </p>
  
  <pre><code>$objDomain = New-Object System.DirectoryServices.DirectoryEntry("LDAP://OU=ivegotusers,DC=global,DC=foo,DC=com")
  
  $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
  $objSearcher.SearchRoot = $objDomain
  $objSearcher.PageSize = 1000
  $objSearcher.Filter = $strFilter
  $objSearcher.SearchScope = "Subtree"
  
  #Write-Host $objSearcher
  
  $colProplist = "name", "sn", "whenCreated", "whenChanged", "createTimeStamp", "modifyTimeStamp", "displayName", "mailNickName"
  foreach ($i in $colPropList){
      $objSearcher.PropertiesToLoad.Add($i)
  }
  
  $colResults = $objSearcher.FindAll()
  
  foreach ($objResult in $colResults){
      $objItem = $objResult.Properties;
      Write-Host -NoNewLine $objItem.name
      Write-Host -NoNewLine "|";
      Write-Host -NoNewLine $objItem.displayName;
      Write-Host -NoNewLine "|";
      Write-Host -NoNewLine $objItem.sn;
      Write-Host -NoNewLine "|";
      Write-Host -NoNewLine $objItem.whenCreated;
      Write-Host -NoNewLine "|";
      Write-Host -NoNewLine $objItem.createTimeStamp;
      Write-Host -NoNewLine "|";
      Write-Host -NoNewLine $objItem.whenChanged;
      Write-Host -NoNewLine "|";
      Write-Host -NoNewLine $objItem.modifyTimeStamp;
      Write-Host "|";
  }
  </code></pre>
  
  <p>So we should get as output a line for each query match, being the line format as follows:
  name|displayName|sn|whenCreated|createTimeStamp|whenChanged|modifyTimeStamp
  right?</p>
  
  <p><strong>I've checked the data in the ADSI Edit and a lot of users had that data; nevertheless, the output was</strong></p>
  
  <pre><code>name1||sn1||||
  name2||sn2||||
  name3||sn3||||
  name4||sn4||||
  name5||sn5||||
  </code></pre>
  
  <p><strong>for those same users, and there's not a single line that has more than these two fields seted.</strong></p>
  
  <p>Can anyone help me figuring out what's happening in here? </p>
  
  <p><strong>Note:</strong> Due to server set-ups, I'm not able to use the ActiveDirectory import on Powershell.</p>
  
  <p>Regards and thanks for your time!
  Vlad</p>