[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1328
  • Last Modified:

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
0
mjm21
Asked:
mjm21
  • 3
2 Solutions
 
rlandquistCommented:
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 BrownSr 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now