Get-Aduser question
hi want retrieve users password expire in less 10 days. so far script goes: #this gets number of days expiry $daystoexpire = (([datetime]::fromfiletime((get-aduser -identity $user -properties "msds-userpasswordexpirytimecomputed")."msds-userpasswordexpirytimecomputed"))-(get-date)).days #this gets users $users= get-aduser -filter {(passwordneverexpires -eq $false) -and (enabled -eq $true)} -searchscope subtree -searchbase "ou=contoso,dc=com" -properties * i want pipe $daystoexpire $users users $daystoexpire -le 10 or can modify this $daystoexpire = (([datetime]::fromfiletime((get-aduser -identity $user -properties "msds-userpasswordexpirytimecomputed")."msds-userpasswordexpirytimecomputed"))-(get-date)).days to filter inly property "msds-userpasswordexpirytimecomputed" has value -le 10? another way trying is creating new object again shows users , daystoexpire, want to display users day