Windows Autopilot is a solution designed that allows you to set up and pre-configure Windows devices for your environment using EntraID and Intune. The goal of Autopilot is to reduce the OS deployment complexity. If done correctly, a user logs into an out-of-box computer, logs on to his computer with his EntraID user account, and applications and configurations get deployed. All that with minimum infrastructure requirements. If you are new to Autopilot, we have a post that describes every step you need to do to get started.

Autopilot has its flaws but it’s improving very fast. One of those flaws was that device importation was made from the Windows Store for Business or the Microsoft Partner Center. Those days are over since you can now import devices directly from Intune.

Intune Autopilot device import

  • Launch Intune
  • Select Device / Enroll Devices / Windows enrollment
  • In the Windows Autopilot Deployment Program pane, select Devices
  • Click on Import at the top

From there, you need to select a .CSV file. It’s not possible to import a single device manually.

As shown in the portal, the CSV file has some formatting requirements :

The header and line format must look like this:

  • <serialNumber>,<ProductID>,<hardwareHash>
  • Can have up to 500 rows in the file

This means you need the Serial Number, Windows Product ID, Hardware Hash separated by a comma. You cannot have more than 500 rows/devices in the CSV.

To get this information for a specific machine, there are a couple of ways :

PowerShell – Intune Autopilot device import

A script is already available in Windows to get this information. As long as that device is running a supported version of Windows. You can use this PowerShell script. The required fields will be populated in a CSV file, ready to import into Intune

From a Windows 10 1703+ computer

  • Start Windows PowerShell as an Administrator
  • Run the following command: Install-Script -Name Get-WindowsAutoPilotInfo
Microsoft Intune Autopilot device import
  • This action places the script into the folder C:\Program Files\WindowsPowerShell\Scripts
  • Run the script: Get-WindowsAutoPilotInfo -Outputfile C:\temp\SCD.csv
  • The script will output the result in the C:\temp\SCD.csv file
  • Open the CSV file, it should look like this :

SCCM / Configuration Manager

If the device is managed by SCCM, you can extract the SerialNumber, ProductID and hardwareHash from a built-in report. All you have to do is Export the data from the report to a CSV file.

  • Go to the Monitoring / Reporting /Reports, / Hardware – General
  • Run the report, Windows Autopilot Device Information
Endpoint Manager Autopilot device import
  • Select the Export icon, and choose the CSV (comma-delimited) option
Endpoint Manager Autopilot device import

Work or School settings app

It’s possible to get a single Hardware hash manually on a PC:

  1. In the Start menu, select Settings.
  2. In Settings, select Accounts 
  3. In the Accounts page, select Access work or school.

Once the Access work or school pane is open in the Settings app, export the log files:

  • Windows 11: In the Export your management log files section, select the Export button.
  • Windows 10: Select the Export your management log files link.
  • Once clicked on the Export button, wait 1-2 min an head to the C:\Users\Public\Documents\MDMDiagnostics directory.
  • In this directory, you’ll have a MDMDiagReport.cab file.
  • This file contains a .csv file which includes the hardware hash of the computer. It will be named DeviceHash_ComputerName.csv
  • Extract this file from the CAB file and keep it for the next step. 

Import the file

Once your CSV file is ready, head back to the Intune Portal to import your Intune devices. Select your CSV file and select Import at the bottom

  • You will receive an Import notification. It will take about 5-10 minutes
Endpoint Manager Autopilot device import
  • Device is imported
Endpoint Manager Autopilot device import

It will take a moment to show in your device list but will eventually appear. The device will also be visible from the Windows Store for Business portal. The device is now imported in Intune and ready for Autopilot deployment.

Comments (13)

Mr.Roop

06.21.2019 AT 03:07 AM
Thanks Benoit , it Helped

Mitch

01.09.2019 AT 12:26 AM
I have found that when running this that no "Windows Product ID" is generated. i get the Hash and the Serial no issues though is there a change required to the script for this?

mitch

01.09.2019 AT 12:36 AM
update script with : >powershell "(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey" this gets OEM key

Nathan Hartley

09.26.2018 AT 03:29 PM
The "Order ID" is optional and arbitrary, as in, it can be anything. If added to the CSV, it is stored on the Azure AD object and can be used for filtering. For instance, to create a Dynamic Device Group... (device.devicePhysicalIds -any _ -eq "[OrderID]:SomeArbitraryValue") Here is Microsoft's explanation... https://docs.microsoft.com/en-us/intune/enrollment-autopilot

Neil

04.26.2018 AT 04:46 PM
Is the hardware hash going to be the same for all identical models? If I have to get the machine out of the box, run a powershell script and reset before I can do the automation, it seems such a waste of time...

Diran

01.23.2019 AT 12:55 PM
Hi Neil, Did you get any response on this as am in the same group with you.

Jason Smith

04.11.2018 AT 12:33 PM
Unfortunately this failed for me. I receive an 'Internal Error, ERROR CODE: 640 - StorageError' This was after the Importer identified 1 correctly formatted row. So I'm not sure what is going on there..

Lucien

04.16.2018 AT 09:26 AM
I got the same error message. In my case, my account has custom permissions in Intune. The import worked when I ran it using the Intune Admin account. Not sure what permission is required to import Window devices though.

Michael Niehaus

04.06.2018 AT 06:05 PM
The need to modify the file was recently removed - Intune now uses the same format as the Microsoft Store for Business, so you can directly upload a CSV created by the Get-WindowsAutoPilotInfo script.

Benoit Lecours

04.09.2018 AT 08:36 AM
Thank you for your update Michael. I'll update the post.

Larry

03.27.2018 AT 08:15 AM
This is inaccurate. Simply running the script nd performing an import works. No need to modify file!

Dorus Rolvink

03.08.2018 AT 10:44 AM
Thanks a lot, this worked for me! Small question, what is the OrderID for, and does it need to increment?