I have a script that runs each day and reminds my users that their password will expire. This works well.
I'm having trouble creating a script to email our helpdesk once the password has expired so engineers can reset it automatically.
The code I have displays nothing yet I know I have expired passwords.
Get-ADUser -filter {(Enabled -eq $True) -and (PasswordNeverExpires -eq $False) -and (PasswordExpired -eq $True)} -properties PasswordLastSet, PasswordExpired, PasswordNeverExpires, EmailAddress, GivenName
Please help!