Tuesday, January 15, 2013

Powershell and Active Directory: Finding User whose password is Expired.

Hi,

Yesterday i have got a call from my remote user, she is  saying that she is not able to login to the Intranet System and Outlook, I asked her if she has got any notifications about password failed (Setting using Group Policies). and she denied.

i said “OK”..

Somehow i feel this is related to her password, i thought let’s see if her password is expired or not.

The best way to check this is using “Powershell”

I opened my Powershell Console.

I imported my ActiveDirectory Module ( Import-Module ActiveDirectory )

and i shoot the command line.

Get-ADUser UserName -Properties *

14-01-2013 13-00-55

and when i scrolled down and i  seen “PasswordExpired : True

14-01-2013 13-00-19

and i call that lady over the phone and  told her to change her password.

You can also use this command line to find all users those password are expired.

Get-ADUser -Filter 'PasswordExpired -eq $true'

All Sorted… and i live “happily ever after” (till the second problem hit me Winking smile)

I love Powershell.

Thanks

Aman Dhally

 

clip_image001 clip_image002 clip_image003 clip_image005 clip_image007

2 comments:

  1. Its Didn't work.Please check once.

    ReplyDelete
    Replies
    1. Was looking for the same thing and your solution didn't work for me either.

      Did some digging. This works:

      Get-ADUser -Filter {PasswordExpired -eq $True}

      Delete

Note: Only a member of this blog may post a comment.