Thursday, 11 December 2025

Create a MECM Query to get Intune Autopilot Device Import Information

Introduction

Intune Autopilot is a great new cloud provisioning feature.  While not as sophisticated as MECM task sequence based provisioning, it is nevertheless much easier to use and to master.  Of course, before we can provision a device using Autopilot, we are required to import the hardware hash into Intune.  One way to get this hardware hash is to run a PowerShell script.  Another way, if the device is in the MECM database,  is to run a canned MECM report called Windows AutoPilot Device Information.


Yes this report gives you the information, and with an export and some manipulation you can import this into Intune.  Many MECM/SCCM administrators, however, prefer to work with MECM queries instead.  They may not be so confident using the Report builder or native Transact SQL.  Mostly queries are there for the administrators only and they can quickly and easily be created as needed - whether that be to supply a manager with required hardware data, or as the underlining query for a collection.  And so I did create the MECM AutoPilot Hash Query.

Creating the AutoPilot Hash Query

In your MECM console navigate to Monitoring\Overview\QueriesRight Click and select Create Query.  Provide a name for the Query such as AutoPilot Hash and then click on Edit Query Statement and then click Show Query Language.  Paste the following query into the Query Statement box.

select SMS_G_System_PC_BIOS.SerialNumber, SMS_G_System_COMPUTER_SYSTEM_PRODUCT.IdentifyingNumber, SMS_G_System_MDM_DEVDETAIL_EXT01.DeviceHardwareData from  SMS_R_System inner join SMS_G_System_PC_BIOS on SMS_G_System_PC_BIOS.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_MDM_DEVDETAIL_EXT01 on SMS_G_System_MDM_DEVDETAIL_EXT01.ResourceID = SMS_R_System.ResourceId left join SMS_G_System_COMPUTER_SYSTEM_PRODUCT on SMS_G_System_COMPUTER_SYSTEM_PRODUCT.ResourceId = SMS_R_System.ResourceId


Click on OK.   Click on Next and then Next again and then on Close.  If desired you can also Right Click on the newly created Query and select Properties, and then limit the results to a collection of your choice; or indeed have it configured so that you are prompted for a collection when you run the report - a very useful feature that is not included with the canned Autopilot report discussed earlier.


Creating the Intune Import csv file

Open notepad and copy into it the following line.

Device Serial Number,Windows Product ID,Hardware Hash


Run the AutoPilot Hash query in the MECM console.  Click on CTRL and A to select the results.



Once selected click on CTRL and C to copy the data into the clipboard.  Press CTRL and V to copy the data into the notepad instance you have open.  Ensure that Word wrap is off and complete a replacement of the whitespace with two commas as shown.



You can now save this notepad file as a .csv file.  For instance, AutoPilotImport.csv.

Importing the Autopilot Hash data into Intune.

Sign into your Intune Portal and navigate to Devices\Windows\Enrollment\Windows Autopilot and then Devices.


Click on Import and browse to your Autopilot import file.  Intune will assess the file for any formatting issues.


Click on Import to register the hash data into Intune.

Conclusion

Retrieving the hardware hash data for Intune can be a tricky and time consuming task.  The MECM Autopilot report goes some way to make this easier - and I hope the Query detailed in this report makes the task even easier for you to manage.  I hope you enjoyed this little blog and I with you much success in your Intune Autopiloting importing tasks.





No comments:

Post a Comment

Create a MECM Query to get Intune Autopilot Device Import Information

Introduction Intune Autopilot is a great new cloud provisioning feature.  While not as sophisticated as MECM task sequence based provisionin...