June 2017
Beginner to intermediate
742 pages
18h 29m
English
Issues due to expired passwords are a common support call that helpdesks get. The following script can generate a report:
## Password Expire Report ##$passwordreport = $null$dc = (Get-ADDomain | Select DNSRoot).DNSRoot$Report= "C:\passwordreport.html"$HTML=@"<title>Password Expire Report For $dc</title><style>BODY{background-color :LightBlue}</style>"@$passwordreport = Get-ADUser -filter * –Properties "SamAccountName","pwdLastSet","msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "SamAccountName",@{Name="Last Password Change";Expression={[datetime]::FromFileTime($_."pwdLastSet")}},@{Name="Next Password Change";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}$passwordreport ...