Skip to content
Collect Hardware Hash from SCCM for Autopilot Easiest Method

Collect Hardware Hash from SCCM for Autopilot Easiest Method

Written By Anoop C Nair
Last Updated August 10, 2021
Posted In SCCM
SHARE

Let’s have a look at the options to collect hardware hash from SCCM for Autopilot import. The easiest way to get this information is shared in the post—all the credit to excellent share by Wolfgang Sauer. There are many other ways to get the hardware hash information from SCCM, but I will share the CMPivot query method.

You can collect the hardware hash from the SCCM database using a simple CMPivot query. I don’t think the devices should be hybrid Azure AD joined or co-managed to get these hardware hash from SCCM. Also, you don’t have to enable any additional hardware inventory class for this method.

The unique serial number of each device hardware is already collected and stored in SCCM DB as part of the default inventory reports. Window Autopilot related information is already available as part of SCCM default hardware reports.

Collect Hardware Hash using CMPivot

Let’s check how to use CMPivot to collect the hardware hash from SCCM (A.k.a ConfigMgr). You can follow the steps below to get the hardware hash details from all the online SCCM devices. You can also check why some of your PCs are offline in SCCM.

Patch My PC
  • Launch Admin Console
  • Navigate to device collection.
  • Select any device collection that you want to collect the Hardware hash.
  • Right-Click on Device collection.
  • Select Start CMPivot.

NOTE! – You can also launch CMPivot from the ribbon menu as well.

Collect Hardware Hash from SCCM for Autopilot
Collect Hardware Hash from SCCM for Autopilot

Once you are in the CMPivot application, you can follow the steps mentioned below to run the CMPivot query to get the Hardware hash of all the devices from SCCM for Autopilot upload.

  • Click on the Query tab.
  • Click on Community hub icon on the far right top corner (I’m using SCCM 2107 version).
Collect Hardware Hash from SCCM for Autopilot
Collect Hardware Hash from SCCM for Autopilot

Select the following query from the list of queries published in Community Hub. The CMPivot query name is “Get Autopilot CSV Info.” You can use the search option to filter it from all other queries. Normally it takes some time to fetch the details from GitHub. So don’t get panic!

Collect Hardware Hash from SCCM for Autopilot
Collect Hardware Hash from SCCM for Autopilot

You can click on the CMPivot query to Get Autopilot CSV Information from SCCM. Once you click on the query, it will get displayed in the CMPivot query field. Thanks to WolfgangSauer (Wolfgang Sauer) (github.com) for sharing this query.

  • You can run the query to get the hardware hash details of SCCM managed devices. Also make sure you go through the comments in the query to create an CSV file that is ready for Autopilot upload.
  • Create an empty CSV file
  • Add this CSV header (remove quotation marks): “Device Serial Number,Windows Product ID,Hardware Hash”
  • Copy / paste the content of a single CSVLine cell to the CSV file and upload it to Autopilot.

Bios
| project Device, SerialNumber
| join (MDMDevDetail) | project Device, CSVLine=strcat(SerialNumber, ',,', DeviceHardwareData)
Collect Hardware Hash from SCCM for Autopilot
Collect Hardware Hash from SCCM for Autopilot

Download the CMPivot Query

I don’t think you need to download the CMPivot query from Community Hub anymore because you can directly get all the queries from the CMPivot application itself. But just in case you want to know what a Community hub is and what the options to download the CMPivot query are? Here is the option:

Collect Hardware Hash from SCCM for Autopilot
Collect Hardware Hash from SCCM for Autopilot

Resources

Written by

Anoop C Nair is Workplace Technology solution architect with 25+ years of experience in global enterprise organizations such as JP Morgan, Capgemini, etc. Microsoft Certified Trainer. Microsoft MVP from 2015 onwards for consecutive 11+ years! He also conducts Intune and modern workplace tech training for enterprise organizations. He is Blogger, Speaker, and Founder of HTMD Community and HTMD Conference. His main focus is on Device Management technologies like Intune, Windows, Cloud PC. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security.

Discussion · 5 comments

  1. Hi Anoop,

    It is an excellent article. But I tried to edit the .csv as you have mentioned but still I’m unable to import due to error “Incorrect headers, cannot proceed further”
    When I execute the powershell in a PC i get the below header which works fine. But from CMPivot result it shows me a error.
    “Device Serial Number,Windows Product ID,Hardware Hash,Order ID”

    Thanks
    Narayanan

    1. Format the file as ASCII/ANSI, don’t use Excel or other editors unless you know how to keep the output as ASCII/ANSI text. UTF-8 is a problem, per Microsoft. I haven’t had any issues with my imports, but figured I’d pass this along since reading it in MS documentation recently.

  2. Incorrect header is likely referring to the file header, not the data header. Our company uses Titus Classification and that will cause this error. You can’t see it in the file but it is present and errors. A work around is to only open and edit in Notepad or use a computer that isn’t shackled :-).

  3. If you want to Include/use -GroupTag in the csv file then below command will work. I have used Hybrid as a group tag and you may change it based on your requirement

    ==================================================================

    Bios
    | project Device, SerialNumber
    | join (MDMDevDetail) | project Device, CSVLine=strcat(SerialNumber, ‘,,’, DeviceHardwareData, ‘,Hybrid’)

    ==================================================================

Join the discussion

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

Related guides

Intune

Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws

Key Takeaways Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws! In the July 2026 Patch, Microsoft introduced new features designed to improve the overall Windows experience. The update adds enhancements to Windows Update for more flexible update management and introduces Point-in-Time Restore, providing an additional recovery option for […]

AC Anoop C Nair 9 min read
Intune

2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws

Key Takeaways 2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws! The June 2026 Windows 11 Patch Tuesday update brings several improvements to File Explorer. It adds support for additional archive formats, including UU, CPIO, XAR, and NuGet Packages (NUPKG). The update also preserves View and Sort preferences in […]

AC Anoop C Nair 10 min read
Intune

2026 May KB5089549 KB5087420 Windows 11 Patch | 0 Zero Day Vulnerabilities and 120 Flaws

Key Takeaways The Windows 11 May 2026 Patch KB5089549 KB5087420 Update brings important security fixes, performance improvements, and reliability enhancements across the operating system. The update introduces new features such as Xbox Mode for gaming, File Explorer improvements, enhanced input and sharing experiences, better taskbar and Windows Hello reliability, and additional enterprise management capabilities for […]

AC Anoop C Nair 8 min read
SCCM

ConfigMgr 2603 Introduces New Early Update Enrollment Process

Key Takeaways In this post we are discussing the ConfigMgr 2603 Introduces New Early Update Enrollment Process. Microsoft has officially released Configuration Manager version 2603 to the Early Update Ring, giving organizations an opportunity to test upcoming improvements before the global production rollout. The release is targeted at enterprises running ConfigMgr version 2409 or later […]

AC Anoop C Nair 3 min read