Find why an account is getting locked out and where

Many a times there comes a request that a user complains that an account is getting locked out for no apparent reason and it’s hard to pinpoint where it is getting locked out from.

I was trying to find out why a user account is getting locked out and where but needed to go through logs to find out my answer. Once the machine name was found, it’s a matter of reviewing services, scheduledtasks, or similar items to see where an account name and password were hardcoded.

I was able to utilize the following script to provide an answer.