Curated Examples
Review enabled users only
Use PSPasswordExpiryNotifications to narrow expiry review to enabled accounts.
This pattern is useful when the first report includes disabled or exception accounts that should not be part of reminder planning.
It is adapted from Example/ListUsers.ps1.
Example
Import-Module PSPasswordExpiryNotifications
Find-PasswordExpiryCheck |
Where-Object {
$_.Enabled -eq $true -and
$_.PasswordNeverExpires -eq $false
} |
Sort-Object -Property DateExpiry |
Select-Object DisplayName, UserPrincipalName, DateExpiry, DaysToExpire, Enabled
What this demonstrates
- narrowing review to enabled users
- keeping notification planning separate from sending
- selecting only the columns needed for a service-desk review