I have a functional script that grabs the Get-ADComputer -Properties PasswordLastSet and displays the computer name and date. What I want is to filter out systems by the date, so I only see systems 30 days older than the date run. Here is what I have that works:
$computers = get-content C:\Scripts\computerlist.txt
ForEach ($comp in $computers)
{
Get-ADComputer $comp -Properties PasswordLastSet | Select-Object Name,PasswordLastSet | Export-CSV C:\Scripts\PasswordLastSet.csv -append -force -NoTypeInformation
}
How do I filter based on the results (date) of PasswordLastSet?
Please mark my post as helpful or the answer or better yet.... both! :) Thanks!