• Skip to main content
  • Skip to primary sidebar

Technipages

Smart phone, gadget and computer tutorials

  • Topics
    • Android
    • Gaming
    • Hardware
    • Internet
    • iOS
    • MacOS
    • Office
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About

PowerShell: Check When User Last Set Active Directory Password

Posted on January 23, 2020 by Mitch Bartlett 1 Comment

If a user can’t access an application that authenticates with Microsoft Active Directory, it’s helpful to check to see when the user last set their password since the application may be using cached credentials. Here’s how to use PowerShell to get the passwordlastset value.

  1. Select the “Start” button, then type “powershell“.
  2. Right-click on “Windows PowerShell“, then select “Run as Administrator“.
  3. Provide credentials for a user that has access to Active Directory.
  4. Now you can use the following to find the when a user set the password last.
  5. Replace “theusername” with the actual username of the user you wish to query:

get-aduser -identity theusername -properties passwordlastset | ft Name, passwordlastset

You could also grab all users in a certain OU using this:

get-aduser -Filter * -properties passwordlastset -SearchBase "OU=Staff,OU=Users,DC=domain,DC=com" | ft Name, passwordlastset

Or just get the enabled accounts:

get-aduser -Filter 'enabled -eq $true' -properties passwordlastset -SearchBase "OU=Staff,OU=Users,DC=domain,DC=com" | ft Name, passwordlastset, enabled

Export it to a CSV file:

get-aduser -Filter 'enabled -eq $true' -properties passwordlastset -SearchBase "OU=Staff,OU=Users,DC=domain,DC=com" | Select Name, passwordlastset, enabled | Export-csv -path c:\Temp\PassLastSet.csv

You Might Also Like

  • Active Directory: How to Check Domain and Forest Functional Level
    Active Directory: How to Check Domain and Forest…
  • How to Add or Delete Printers in Active Directory
    How to Add or Delete Printers in Active Directory
  • How to Add Active Directory Schema Snap-In
    How to Add Active Directory Schema Snap-In
  • How to Make Active Directory Replicate Instantly
    How to Make Active Directory Replicate Instantly
  • Active Directory: Fix Replication Error 8203
    Active Directory: Fix Replication Error 8203
  • How to Find Computer Locking Active Directory Account
    How to Find Computer Locking Active Directory Account
  • Windows 10 & 8: Install Active Directory Users and Computers
    Windows 10 & 8: Install Active Directory Users and Computers
  • Use Active Directory Domain Services to Block Website
    Use Active Directory Domain Services to Block Website
  • Linux Passwords: How To Force a User To Reset Their Password
    Linux Passwords: How To Force a User To Reset Their Password

Filed Under: Windows Tagged With: Active Directory, PowerShell

Reader Interactions

Comments

  1. Mubashir says

    October 9, 2020 at 1:13 am

    Thank You

Did this help? Let us know! Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • Fix Skype Error: Exchange Needs Your Credentials
  • Fix Skype Notifications Not Working on Windows 10
  • Teams in Outlook: We Couldn’t Schedule the Meeting
  • VR Oculus Quest 2: How to Configure a New Room-Scale Boundary
  • VR Oculus Quest 2: How to Adjust Boundary Sensitivity
  • Dropbox: How To Change the Date Format
  • Microsoft Teams: There Was a Problem Saving the Photo
  • VR Oculus Quest 2: How to Set up Oculus Link

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

Follow me on Twitter, or visit my personal blog.

You May Also Like

  • One-Time Password
  • Need a Big Tablet? Check out These Top 8 Picks!

© Copyright 2021 Technipages · All Rights Reserved · Privacy