• 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 logo
    Active Directory: How to Check Domain and Forest Functional…
  • Printer Header
    How to Add or Delete Printers in Active Directory
  • Active Directory logo
    Windows 10 & 11: Install Active Directory Users and…
  • Active Directory logo
    How to Make Active Directory Replicate Instantly
  • Active Directory logo
    Active Directory: Fix Replication Error 8203
  • Active Directory logo
    Use Active Directory Domain Services to Block Website

Filed Under: Windows

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

  • How to Send HD Pictures and Videos on WhatsApp
  • How to Share Files Using Google Nearby Share
  • Android Battery Will Not Charge Fix
  • Turning on Triple Touch Zoom on Android
  • How to Connect Outlook 2023 to Gmail
  • Netflix: Change Password
  • Step-by-Step Guide: How to Use WhatsApp on Your Computer
  • Android: Enable or Disable Background Data

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

  • Set-Associative Cache
  • ASCII Character Set
  • One-Time Password

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