• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About

PowerShell: Check When User Last Set Active Directory Password

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 Functional…
  • How to Add or Delete Printers in Active Directory
    How to Add or Delete Printers in Active Directory
  • 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 & 11: Install Active Directory Users and Computers
    Windows 10 & 11: Install Active Directory Users and…

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!

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

  • What is a Security Compromise?
  • Mastodon: How to DM Someone
  • 15 Best iOS 16 Beta 3 Features You Should Try Now
  • Android: How to Record and Add Custom Alarm Audio
  • What is a Hackathon?
  • How to Enable Samsung Adapt Sound for the Best Audio
  • What is Social Engineering?
  • Google Voice Typing Not Working: Fix

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.

You May Also Like

  • One-Time Password

© Copyright 2023 Guiding Tech Media · All Rights Reserved · Privacy