• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

List of users' password validity in AD

Hello,
could anybody provide with any script (PowerShell) that I could run and get passwords validity off all my users in AD.

A.
0
ikealt
Asked:
ikealt
  • 3
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
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
 
Pramod UbheCommented:
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
 
ikealtAuthor Commented:
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
 
ikealtAuthor Commented:
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
 
ikealtAuthor Commented:
ok, thanks it works.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now