Enumerate locked out user accounts using Saved Queries

This article provides some step-by-step instructions to enumerate locked out user accounts using Saved Queries.

Applies to:   Windows Server 2012 R2
Original KB number:   555131

This article was written by Simon Geary, Microsoft MVP.

More Information

Follow these step-by-step instructions to list all currently locked out accounts in a domain:

  1. Sign in to a Domain Controller with administrative privileges in the domain, and open Active Directory Users & Computers.

  2. Right-click Saved Queries and select New > Query.

  3. Give the query a name and optionally a description. Select Define Query.

  4. Select Custom Search from the drop-down dialogue box.

  5. Select Advanced and enter this LDAP filter in the query box:

    (&(objectCategory=Person)(objectClass=User)(lockoutTime>=1))

  6. Select OK twice and the new query appears under the Saved Queries folder in Active Directory Users & Computers.

Community Solutions Content Disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.