title: Get Ad user Created date
body: <p>I'm trying to export various user data, but I'm having trouble with the "created date"
  I'm using:</p>
  
  <pre><code>Get-ADUser -Filter * –Properties DisplayName, givenName, sn, SamAccountName, Enabled, lastLogonTimestamp, whenCreated |
  Select DisplayName, givenName, sn, SamAccountName, Enabled,
      @{n="lastLogonDate";e={get-date ([datetime]::FromFileTime($_.lastLogonTimestamp)) -f MM/dd/yyyy}},
      @{n="Created";e={get-date ([datetime]::FromFileTime($_.whenCreated)) -f MM/dd/yyyy}}| 
  Export-CSV -NoType .\usrtst01.csv
  </code></pre>
  
  <p>But,The export goes like this:</p>
  
  <p>"User test","User","test","user.test","True","04/01/2020",</p>
  
  <p>However, if I use the code like this:</p>
  
  <pre><code>Get-ADUser -Filter * –Properties DisplayName, givenName, sn, SamAccountName, Enabled, lastLogonTimestamp, whenCreated |
  Select DisplayName, givenName, sn, SamAccountName, Enabled,
      @{n="lastLogonDate";e={get-date ([datetime]::FromFileTime($_.lastLogonTimestamp)) -f MM/dd/yyyy}}, whenCreated | 
  Export-CSV -NoType .\usrtst02.csv
  </code></pre>
  
  <p>The export:</p>
  
  <p>"User test","User","test","user.test","True","04/01/2020","01/04/2020 8:28:31 AM"</p>
  
  <p>The problem is that I need the format:</p>
  
  <p>MM/dd/yyyy</p>
  
  <p>Could you helpme please.</p>
  
  <p>Thanks.</p>