Hello,
I have the following code to get the password expiration report. I need assistance in modifying the code to get just the total counts of users password expiring on a specific date. For instance: 01/01/2016
Import-Module ActiveDirectory
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False -and physicalDeliveryOfficeName -like "*" } `
–Properties "SamAccountName","mail","pwdLastSet","physicaldeliveryofficename","msDS-UserPasswordExpiryTimeComputed" |
Select-Object -Property "SamAccountName","mail","physicaldeliveryofficename",@{Name="Password Last Set";`
Expression={[datetime]::FromFileTime($_."pwdLastSet")}}, @{Name="Password Expiry Date";`
Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} |
Export-CSV "C:\PasswordExpirationReport.csv" -NoTypeInformation -Encoding UTF8