Use PowerShell to find out if user password expired

Here is a quick way to find out if the user’s password expired and some other useful password-related information (when was the password last set, whether the password is set to never expire):

  • Open Windows PowerShell with Active Directory module.
    If you are doing this on a client machine, you will need to install Remote Server Administration Tools (link for Windows 7).
    To load the Active Directory module in PowerShell, run import-module ActiveDirectory
  • Run: Get-ADUser -identity <user.name> -properties PasswordLastSet, PasswordExpired, PasswordNeverExpires | ft Name, PasswordLastSet, PasswordExpired, PasswordNeverExpires
    Get-ADUser -identity
  • To get the same information for all users (sorted by name), run:
    Get-ADUser -filter * -properties PasswordLastSet, PasswordExpired, PasswordNeverExpires | sort Name | ft Name, PasswordLastSet, PasswordExpired, PasswordNeverExpires
    Get-ADUser -filter *

Windows Server 2008 R2 domain


Comments

Leave a Reply

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