Bobcares

Using Saved Queries in ADUC MMC (Active Directory User and Computers)

by | Oct 9, 2020

ADUC MMC (Active Directory User and Computers) is a popular tool that manages Active Directory objects.

Here at Bobcares, we have seen several such Windows related queries as part of our Server Management Services for web hosts and online service providers.

Today we’ll see about using saved queries in ADUC MMC (Active Directory User and Computers).

 

Know more about ADUC MMC

The Saved Queries in Active Directory Users and Computers (ADUC) MMC console generally allows you to create complex LDAP filters to select Active Directory objects. Moreover, you can save these queries, edit them, and copy them to other computers.

These Saved Queries mainly help you to quickly perform common AD object administration tasks. When you are using any saved LDAP queries, the administrator can perform group operations with objects from different OUs (containers) of Active Directory.

 

How to Create a Saved Query in the ADUC MMC Console?

Now let’s take a look at a few typical examples of using saved LDAP queries in Active Directory Users and Computers console to search for objects.

In case, we need to display the list of active user accounts, their department names, and e-mail addresses.

1. First, open the ADUC console (dsa.msc). Then right-click Saved Queries and select New >> Query

2. In the Name box, specify the name of the saved query you would want to display in the ADUC console.

3. Specify the container (OU) in which you want to search in the Query root field. By default, the search by the query criteria is performed across the entire AD domain.

4. Click on the Define Query button, and from the Find drop-down list, select the Custom Search option.

5. Then go to the Advanced tab and copy the following LDAP query into Enter LDAP query box. This query selects enabled user account.

(&(objectcategory=person)(objectclass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))

6. Click on OK to save the changes.

7. Select the created query in the ADUC console and press F5 to build the object list. Then a list of users will appear in the right window that matches the LDAP query

8. If you wish to display the additional user attributes then open the View menu in the ADUC console and select Add/Remove Columns.

9. Now add the columns that you want.

10. The resulting list of user accounts can be saved to a CSV or TXT file for further analysis and import into Excel. For doing that, right-click on the saved query and select the Export List menu item.

Also, you can get data from AD using PowerShell and save it directly to an Excel file.

Moreover, in the ADUC console, you can create a number of different saved queries and then organize them in a tree structure. In this way, you can create a convenient collection of LDAP queries to quickly perform common AD administration tasks.

The ADUC MMC snap-in supports several modes of building Active Directory saved queries. Also, you need not specify the LDAP filter code each time instead you can create your AD query with a simple graphical wizard. Just select different attributes of AD objects and use them to search objects according to the criteria you want.

For instance, to list all Windows Server computer objects in a domain:

1. Find Computers
2. Click on the Advanced tab
3. Under Fields section -> Operating System
4. Condition must be ‘Starts with’ -> specify your criteria ‘Windows Server *‘

The wildcard is * (you can specify ‘*Server*‘). Multiple search criteria can be added to your saved query.

Now save the query and refresh the object list. As a result, the list will show all Windows Server objects in your domain.

 

Using LDAP Filters in PowerShell

You can use the different LDAP filters to find AD objects in the PowerShell console. Most of the cmdlets from the PowerShell Active Directory module have a special LdapFilter parameter. You would need to specify your LDAP query in this parameter. For instance,

Get-ADUser -LdapFilter "(&(objectCategory=person)(objectClass=user)(department=*Sales department*))"| ft -a DisplayName,department

The Get-ADUser, Get-ADComputer, and Get-ADGroup cmdlet are some of the specialized cmdlets and are used to find objects of a certain type – users, computers, or groups.

In case, if you don’t have an idea about the type of AD object you want, or if you need information about all types of objects, use the more common Get-ADObject cmdlet.

[Need any further assistance with Windows queries? – We are here to help you.]

 

Conclusion

In today’s writeup, we saw about using saved queries in ADUC MMC (Active Directory User and Computers).

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF