Friday, May 9, 2014

Saved Queries - Active Directory

Saved Queries option in Active Directory is used for searching  results more faster rather than searching in Active Directory for objects. Saved Queries provides a quick and consistent way for administrators to access a common set of directory objects. 

Saved Queries use predefined LDAP strings to search only the specified Domain partition. Active Directory Users and Computers provides a Saved Queries folder in which administrators can Create, Edit, Save and organize saved Queries.






All Queried which we make gets save in Saved Queries folder in Active Directory Users and Computers (dsa.msc). All Saved Queries which are saved can be viewed later. We can also copy .msc file of Saved Queries to other Domain Controllers using Windows Server 2003 (located in the same domain) and can use same set of Saved Queries. You can also Export Saved Queries to an .xml file and can import them in to  other Active Directory User and Computer consoles located on domain controllers running Windows Server 2003 within same Domain.


Suppose we want to see whose AD ID's are disabled, We need to create one Query for same inspite of  searching all users in AD:


1. Open Active Directory Users and Computers windows by typing dsa.msc in run window.




2. Right Click on Saved Queries and click on New Query.




3. Give Name and Description as per your requirement.




4. Click on Browse option to select Domain in which we want to make Query.




5. After Selecting Domain Click on Define Query to define our queries.

 


6. Click on Disabled Accounts option and Click Ok.




7. After Clicking OK it will show results for all Disabled Users.





This way we can make Queries for different purposes.