Solved

List of users' password validity in AD

Posted on 2013-01-31
5
437 Views
Last Modified: 2013-01-31
Hello,
could anybody provide with any script (PowerShell) that I could run and get passwords validity off all my users in AD.

A.
0
Comment
Question by:ikealt
  • 3
5 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38839305
here:

cls
   import-module ActiveDirectory
   $reportObject = @()
$userList = Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq  $False} -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" |  Where-Object {$_.DisplayName -ne $null}
$userList | %{

    $output = "" | Select DisplayName, ExpiryDate
    $output.DisplayName = $_.DisplayName
    $output.ExpiryDate = ([datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")).DateTime
    $reportObject += $output
    #Next 2 Lines provide debugging... I'm not sure the date time portion will work without having AD to play with
#    $output | fl *
#    ([datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")).DateTime 
}

$reportObject | Convertto-CSV -NoTypeInformation

Open in new window



From: powershell-get-password-expiration-for-all-non-disabled-users-in-ad
0
 
LVL 10

Expert Comment

by:Pramod Ubhe
ID: 38839522
So you need to check if user's password expired or not right?
I can give it to you tomorrow if you don't get it till that time.
0
 

Author Comment

by:ikealt
ID: 38839540
actually I need like a table with user name and date then password was changed / created and then will expire. Through GPO I set password validity for 110 days.
0
 

Author Comment

by:ikealt
ID: 38839554
one thing sedgwick, this script has to be run on a server, or can I run from any computer in AD with admin rights?
0
 

Author Comment

by:ikealt
ID: 38839572
ok, thanks it works.
0

Join & Write a Comment

Know what services you can and cannot, should and should not combine on your server.
Synchronize a new Active Directory domain with an existing Office 365 tenant
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now