Wednesday 1 September 2010

Save queries in Windows Server 2003's Active Directory Users and Computers tool


Windows Server 2003 administrators can’t live without the Active Directory Users and Computers tool. Here’s a quick look at the saved queries portion of the tool, which allows you to save and reuse lookups for different Active Directory (AD) objects. The ability to reuse queries can save time and speed up the process of locating objects within your AD environment.
The Active Directory Users and Computers tool is included in the AD implementation used by Windows Server 2003. The following steps will help in saving AD queries:
  1. Open Active Directory Users And Computers.
  2. Right-click the Saved Queries folder in the left pane of the window.
  3. Select New and choose Query.
  4. Enter a name and description for your saved query. (The description is optional, but it can help you remember what the query is looking for if you ever need to revisit the query definition.)
  5. Click the Define Query button, which will open the Common Queries window. (You’ll find that Microsoft has created a few predefined queries to assist you in finding certain objects. For this example, we will create our own query to find any users whose last names are similar to Miller.)
  6. In the Find box, select Users, Contacts, And Groups.
  7. Select the Advanced tab.
  8. Click the Field button, select User, and then select Last Name.
  9. For an operator in the center list box, select Is Like.
  10. Enter Miller or Mille* in the final text box on the row and click Add.
  11. Click OK in the Define Query window to return to the New Query window. (In the New Query window, you can also choose to include sub containers. Selecting this will search in any child organizational units or container objects for things that meet the conditions of the query you created.)
  12. Click OK to close the New Query window and return to Active Directory Users And Computers.
Your query will appear saved beneath Saved Queries in the left pane of the console. To execute the query, right-click it and choose Refresh. If you select the query without refreshing, the results from the last time you ran the query will appear.
This method does not circumvent or remove the need for Active Directory Users and Computers, but it may make it a little more useful. Remember that you can create truly custom queries for all of the AD object properties in your environment.

No comments:

Post a Comment