Build precise queries to find exactly what you need
Press ESC to close
I tried this script with PasswordExpired and I found no result. When I ran:
Get-ADUser -Filter * -Property PasswordExpired | Where {$_.Enabled -eq ‘True’ -and $_.PasswordExpired -Eq ‘True’}
I do get 1 result. It seems Search-ADAccount and Get-ADUser are giving different results.
I tried to change the script:
if($action -eq “PasswordExpired”) { $command=”Get-ADUser -Filter * -Property PasswordExpired | Where {$_.Enabled -eq ‘True’ -and $_.PasswordExpired -Eq ‘True’}” $result=invoke-expression $command } else { $command=”Search-ADAccount -“+$action+” -SearchBase ‘”+$searchBase+”‘ -SearchScope “+$searchScope $result=invoke-expression $command }
I did not get any result with this change. How can I get the correct response for PasswordExpired accounts?
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!