Does any event id generates when user account password gets expired? I was hoping to write a script which triggers through event?
I did look around but did not find anything related to password expiration - only found related to account expiration.
Does any event id generates when user account password gets expired? I was hoping to write a script which triggers through event?
I did look around but did not find anything related to password expiration - only found related to account expiration.
In short, no.
A password expiration isn't really an event that happens. It's a calculation that DCs perform at the moment of authentication based on the attributes on the account and password policies that apply to the account. An account whose password is currently expired might no longer be expired if you change the policies surrounding maximum password age or add a flag that it never expires.
So if you're trying to write a script that does something with accounts who have expired passwords, you're going to have to do it as a point-in-time sort of calculation as well. If your AD is 2008 based or later, you have access to the msDS-UserPasswordExpiryTimeComputed constructed attribute which basically takes into consideration everything that would contribute to a password's expiration and gives you a timestamp of when that user's password will (or has) expired.
Since these are Active Directory users you are talking about, why not query the domain instead of triggering on an event? There are scripts available that will find expiring accounts and even e-mail the user if you like.
I'm not sure what you intend to do once you find an expired password, but this PowerShell query will get you all enabled domain user accounts that have an expired password:
Get-ADUser -Filter {(Enabled -eq $true) -and (PasswordNeverExpires -eq $false)} -Properties PasswordNeverExpires,PasswordExpired | where {$_.PasswordExpired -eq $true}
It would be much easier to loop through the output of that command than running event id task triggers on all of your Domain Controllers (assuming you do have multiple Domain Controllers).