ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Passwords Last Changed

    IT Discussion
    nerdydad ps scripts
    3
    3
    674
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • NerdyDadN
      NerdyDad
      last edited by NerdyDad

      So here is something that I just whipped up real quick one liner.

      get-aduser -Filter * -Properties * | Select CN,PasswordLastSet,EmailAddress | sort PasswordLastSet | export-csv \\your_desired_location\passwords_unchanged.csv
      

      First part grabs all of your users in your AD and all of their properties. Its piped over and only pulls out the users name, their email address, and the last time they changed their password. The next pipe sorts the list based from oldest to newest of the passwords. With that list sorted, it is then piped to a csv spreadsheet to be done with what you will.

      Part of the NerdyDad's PowerShell Script series

      thwrT 1 Reply Last reply Reply Quote 2
      • thwrT
        thwr @NerdyDad
        last edited by thwr

        @nerdydad said in Passwords Last Changed:

        So here is something that I just whipped up real quick one liner.

        get-aduser -Filter * -Properties * | Select CN,PasswordLastSet,EmailAddress | sort PasswordLastSet | export-csv \\your_desired_location\passwords_unchanged.csv
        

        First part grabs all of your users in your AD and all of their properties. Its piped over and only pulls out the users name, their email address, and the last time they changed their password. The next pipe sorts the list based from oldest to newest of the passwords. With that list sorted, it is then piped to a csv spreadsheet to be done with what you will.

        Part of the NerdyDad's PowerShell Script series

        Take care with this one. I had a problem once because the PasswordLastSet attribute is one of the few attributes that isn't replicated between DCs by default.

        Wrote a powershell script a bit ago (hell, I need more time for my blog...) that querys all DCs: https://www.windrath.com/2016/07/powershell-total-badpwdcount-adusers/ - you could adapt it to get the newest PasswordLastSet value

        1 Reply Last reply Reply Quote 1
        • A
          Alex Sage
          last edited by

          Worked perfectly for me! Thanks!

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post