This PowerShell script shows How to find locked out user account location in domain.
There are many reasons caused account locked out. The user has logged onto another machine, and not logged off. Then, if the user has changed their password while the other machine is logged in, it could be requesting resources using the old (and now incorrect) password. Every time it tries to get a network resource that requires authentication it will cause a bad password attempt. This script can scan where the locked out user account location.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery