title: Powershell to get accounts with passwords older than "$"
body: <p>I am trying to get a list of accounts with passwords that are older than lets say 90 days but something is not working right and I am not sure why.</p>
  
  <pre><code>Get-ADUser -Filter 'Enabled -eq $True' -Properties PasswordLastSet,samaccountname,passwordlastset | Where-Object {$_.PasswordLastSet -gt ($_.PasswordLastSet).adddays(1)} | select Name,samaccountname,passwordlastset
  </code></pre>
  
  <p>This is what i got so far but if I run it as is it returns 0 results. I know there are passwords that are older than one day, mine is one of them. Any help is appreciated.</p>