Powershell - Active Directory - filter PasswordLastSet by today
<p>I have the following powershell it works without the filter. However, if I want to see whether passwordlastset was today it throws an error. I am trying to compare the date (without the time). </p>

<p>This line throws error: </p>

<pre><code>Get-ADUser -identity svc-sap-dataRead -ldapfilter passwordlastset=get-date -properties passwordlastset

Get-ADUser -identity svc-sap-dataRead -properties passwordlastset

DistinguishedName : CN=svc-sap-dataRead,OU=Service Accounts,OU=SAP-
                    OG,OU=Applications,OU=Prod-Groups,DC=csi,DC=com
Enabled           : True
GivenName         :
Name              : svc-sap-dataRead
ObjectClass       : user
ObjectGUID        : dcbadba0-3cd7-4e51-9d14-d0e8a6be17f5
PasswordLastSet   : 5/6/2016 8:44:13 AM
SamAccountName    : svc-sap-dataRead
SID               : S-1-5-21-3791487480-1111548175-1301309645-519760
Surname           :
UserPrincipalName : svc-sap-dataRead@csi.com
</code></pre>

<p>Just tried the following code: it does not error nor gives me anything back.</p>

<pre><code>Get-ADUser -identity svc-sap-dataRead -properties passwordlastset |
where {$_.passwordlastset -eq (get-date)}|select-object passwordlastset, name
</code></pre>