Use CMPivot to find machines connected to a specific domain

Use CMPivot to find Device Domain Name in SCCM

Last Updated

August 22, 2025

Posted In

In this post, I will show you how to use CMPivot to find device domain name in SCCM. By running a simple KQL query, you can quickly identify machines connected to a specific domain and export the details to a CSV file.

I have seen organizations using an SCCM server to work for both domains in separate forests. Managing clients from different domains in Configuration Manager often requires identifying the domain each client is connected to. Instead of manually checking these details for every computer, you can efficiently gather this information using CMPivot.

CMPivot queries the data in real-time, so you get accurate results. One important thing to remember here is when you have a collection that contains devices from another site, CMPivot results include the devices on the current site unless CMPivot is run from the CAS.

Install and Update Third Party Applications with Patch My PC
Install and Update Third Party Applications with Patch My PC

Find machines connected to a specific domain with CMPivot

Here’s how you can run a CMPivot query to find domain information of Windows devices in a Configuration Manager environment. First, launch the SCCM console and navigate to Assets and Compliance > Overview > Device Collections. Right-click a device collection and select Start CMPivot.

Find machines connected to a specific domain with CMPivot
Find machines connected to a specific domain with CMPivot

Switch to the Query tab of the CMPivot tool. Paste the below query (replace the domain name with yours) into the query editor and click Run.

Device | where Domain == ('YOUR DOMAIN NAME')

In the query results, the ‘Domain‘ column shows the domain name that devices are connected to.

Using CMPivot to find Device Domain Name
Using CMPivot to find Device Domain Name

If you want to find out the computers that aren’t joined to a specific domain, you can use the below CMPivot query.

Device | where Domain != ('Your Domain Name')

Lastly, there is an export option in the CMPivot query window that allows you to export the device’s domain information to an external file (CSV file).

Leave a Reply

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

Prajwal Desai

Prajwal Desai is a highly accomplished technology expert and an 11-time Dual Microsoft MVP (Most Valuable Professional), specializing in Microsoft Intune, SCCM, Windows 365, Enterprise Mobility, and Windows. As a renowned author, speaker, and community leader, he is widely recognized for sharing his in-depth expertise and insights through his blog, YouTube channel, conferences, webinars, and other platforms.