Using saved queries
Updated: January 21, 2005
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
Using saved queries
Saved queries provide a quick and consistent way for administrators to access a common set of directory objects on which to perform specific tasks or to monitor. Saved queries use predefined LDAP strings to search only the specified domain partition, and searches can be narrowed down to a single container object. You can also create a customized saved query that contains a LDAP search filter. For more information about saving queries, see Create a saved query. For more information about LDAP search filters, see the Internet Engineering Task Force Web site and search for "Representation of LDAP Search Filters."
Active Directory Users and Computers provides a Saved Queries folder in which administrators can create, edit, save, and organize saved queries. Before saved queries, administrators were required to create custom ADSI scripts that would perform a query on common objects. This was an often lengthy process that required knowledge of how ADSI utilizes LDAP search filters to resolve a query.
All queries located in the Saved Queries folder are stored in Active Directory Users and Computers (dsa.msc). Once you have successfully created your customized set of queries you can copy the .msc file to other domain controllers running Windows Server 2003 (located in the same domain) and use the same set of saved queries. You can also export saved queries to an .xml file and import them into other Active Directory User and Computer consoles located on domain controllers running Windows Server 2003 (within the same domain). For more information about saving console files, see Saving consoles.
You can save queries to search for disabled user or computer accounts, number of days since the last user logon, users with non-expiring Passwords, and many other commonly used queries. Once a saved query is executed and the desired objects are displayed, each object can then be modified directly through a query results screen. You can then select multiple objects and perform a task on them. For example, you can use a drag-and-drop operation to move two or more displayed objects onto a group.