Powershell / quest commandLets script that will check for users with expired passwords on a partuicular OU and export to .csv file

Powershell / quest commandLets script that will check for users with expired passwords on a partuicular OU and export to .csv file
mjm21Asked:
Who is Participating?
 
rlandquistConnect With a Mentor Commented:
Give this a try:
Get-QADUser -Enabled -passwordNeverExpires:$False | where { ( $_.PasswordExpires -lt Get-Date )}|Select name|Export-Csv c:\Users.csv

Open in new window

0
 
rlandquistCommented:
Sorry, typo, use this one:
Get-QADUser -Enabled -passwordNeverExpires:$False | where { ( $_.PasswordExpires -lt (Get-Date) )}|Select name|Export-Csv c:\Users.csv

Open in new window

0
 
Adam BrownConnect With a Mentor Sr Solutions ArchitectCommented:
The attached code is a little simpler, but does the same thing. But if you want to export the users that don't have expired passwords, you can put a ! in front of $_.passwordisexpired
get-qaduser | where {$_.passwordisexpired} | select name | Export-csv c:\expiredpasswords.csv

Open in new window

0
 
mjm21Author Commented:
Thanks.  Works great!
0
 
rlandquistCommented:
Glad to help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.