title: How to check user must change password at next logon flag via Powershell
body: <p>I have been  doing to report all user accounts that have the user must change password at next logon flag set, My question is : how do I set as <code>user must change password at next logon</code> instead of <code>1/1/1601 2:00:00 AM</code> in CSV output ?</p>
  
  <pre><code>Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed", "Title", "manager", "department", "employeeid"  | Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}},"Title",@{n=”Manager Name”;e={(Get-ADuser -identity $_.Manager -properties displayname).DisplayName}},"Department","employeeid" | sort-object -property ExpiryDate | Export-Csv -Path "c:\export\expirydatenew.csv" -NoTypeInformation -Encoding UTF8
  </code></pre>