Skip to main content
Systems Engineering

Part 2: Register Devices in Windows Autopilot: Import Hardware Hashes into Intune

Capture a pilot laptop's hardware hash with Get-WindowsAutopilotInfo, tag it AP-Pilot, import the CSV into Intune, and leave the Entra device object that registration creates alone.

Detailed view of a laptop keyboard featuring Arabic letters and Windows key.
KBY Technologies11 min read

In this guide

Advertising disclosure: this article includes partner links. KBY may earn a commission if you sign up or buy through one, at no extra cost to you. How we make money.

Share

Continue the series

You are reading Part 2 of 6

Windows Autopilot with Intune, Step by Step

View all parts
All published parts
Part 1Windows Autopilot Prerequisites in Intune: Licences, Automatic Enrolment and Branding
Part 2Register Devices in Windows Autopilot: Import Hardware Hashes into IntuneCurrent

#What this part does

To register a device with Windows Autopilot yourself, capture its hardware hash with Get-WindowsAutopilotInfo, save it to a CSV file with a group tag, and import that file in the Intune admin centre under Windows Autopilot > Devices. The key constraint: Microsoft treats manual hash registration as mainly for testing and evaluation, and for production devices it prefers the manufacturer, reseller or Cloud Solution Provider (CSP) partner to register them for you. That makes manual registration the right tool for a pilot, and the wrong one for a fleet.

By the end of this part, one pilot laptop is registered in Windows Autopilot with the group tag AP-Pilot and is listed in Intune. You will also know which Microsoft Entra device object registration creates, and why you must not delete it by hand.

#Where Part 1 left the tenant

Part 1 prepared the tenant without touching a device: pilot users in SG-Autopilot-Pilot hold licences that include Intune and Microsoft Entra ID P1, automatic MDM enrolment is scoped to that group, pilot users may join devices to Microsoft Entra ID, and classic Windows Autopilot with user-driven Microsoft Entra join was chosen over Autopilot device preparation. Classic Autopilot needs every device registered before it can deploy, which is what this part does.

For the pilot device, use a spare laptop running a supported Windows edition (Pro, Enterprise, Education or one of the other editions listed in Part 1) that you can reset later in the series. Microsoft says devices that are Microsoft Entra registered (“workplace joined”) or enrolled as MDM-only should not be registered as Autopilot devices, because Autopilot registers devices as corporate owned. Microsoft’s registration overview explains what such a laptop needs before it can be registered; for the pilot, simply pick one that is neither.

You need the Intune Administrator or Policy and Profile Manager role to register devices. A custom role works too: Microsoft says Autopilot device management needs all the Enrollment programs permissions except the four token management options. Either way, the admin account also needs consent to use the Microsoft Intune PowerShell and Microsoft Graph PowerShell enterprise applications.

#Step 1: Decide how devices will be registered

Registration ties a device’s hardware identity to your tenant in the Windows Autopilot deployment service. There are three routes:

Ways to register devices with Windows Autopilot, from Microsoft’s registration documentation
RouteWho does itWhat it needs
Manufacturer (OEM)The manufacturer, on your behalfA Global Administrator approves the OEM first; the OEM writes to the Autopilot service, not to your tenant
Reseller, distributor or CSP partnerThe partner, in Partner CenterA Global Administrator approves the partner relationship; delegated administration permissions are not required and can be deselected. Partners can register with the PKID from the packaging or a tuple
ManualYou, in IntuneA 4K hardware hash captured from the running device, uploaded in a CSV file of up to 500 devices

Customers can only register with a hardware hash; PKID and tuple registration are available only to manufacturers and CSP partners. Microsoft describes manual registration as primarily for testing and evaluation, because capturing the hash means booting the device into Windows. It also recommends uploading 4K hashes through Intune only for testing or other limited scenarios, partly because those hashes contain sensitive information that only device owners should hold. For new laptops in production, ask your supplier to register them to your tenant when you order. This series registers one pilot device manually.

#Step 2: Capture the hardware hash with a group tag

The hardware hash identifies the device from details such as its manufacturer, model, serial number and drive serial number. It changes every time you generate it, because it records when it was generated, and the Autopilot service still matches the device. Large hardware changes, such as a motherboard replacement, do not match, and need a new hash.

A group tag is a short label stored with the registration. Set it now: Part 3 builds a dynamic device group on it. Intune’s group tag field maps to the OrderID attribute on the Microsoft Entra device. This series uses AP-Pilot. Type it the same way every time, because a group rule matches the text you give it.

Microsoft’s current Get-WindowsAutopilotInfo script (version 3.9 on the PowerShell Gallery) was updated in July 2023 to use the Microsoft Graph PowerShell modules instead of the deprecated AzureAD modules; install it fresh rather than reusing an old copy. On the pilot laptop, sign in, open Windows PowerShell as administrator and run:

1[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
2New-Item -Type Directory -Path "C:\HWID"
3Set-Location -Path "C:\HWID"
4$env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"
5Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
6Install-Script -Name Get-WindowsAutopilotInfo
7Get-WindowsAutopilotInfo -OutputFile AutopilotHWID.csv -GroupTag AP-Pilot

This is Microsoft’s documented procedure with -GroupTag added. The execution policy change applies only to this PowerShell session. If prompted, agree to install NuGet from the PowerShell Gallery. The script writes C:\HWID\AutopilotHWID.csv with the columns Device Serial Number, Windows Product ID, Hardware Hash and Group Tag. An empty Windows Product ID is normal: it is not needed to register a device. Note the serial number, because you will search for it in Intune. Copy the file to your admin workstation, somewhere only administrators can read, and do not leave copies lying around: the hash is sensitive.

#
The alternative: upload directly with -Online

The script can also upload the hash itself, which is useful on a laptop sitting at the out-of-box experience (OOBE): at the sign-in prompt after OOBE starts, press Shift+F10, run powershell.exe, and then run:

1[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
2Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
3Install-Script -Name Get-WindowsAutopilotInfo -Force
4Get-WindowsAutopilotInfo -Online -GroupTag AP-Pilot

The last command asks you to sign in with an account that is at least an Intune Administrator. On first use it asks for consent to its permissions, which include read-write access to Intune enrolment settings, managed devices, Entra devices and groups. It then imports the device, waits for the import and sync, and prints how many devices imported successfully.

This series uses the CSV route, because it shows you the file and keeps the upload on your admin workstation. If you do use -Online at OOBE, shut the laptop down after the upload rather than continuing setup: it has no deployment profile until Part 3.

#Step 3: Import the CSV in Intune

  1. Sign in to the Microsoft Intune admin centre.
  2. Go to Devices > Windows, then under Device onboarding select Enrollment.
  3. Under Windows Autopilot, select Devices.
  4. Select Import, browse to AutopilotHWID.csv and select Import. The import can take several minutes.
  5. When it finishes, select Sync, then Refresh until the device appears.

If you combine several devices into one file, keep Microsoft’s format: the header Device Serial Number,Windows Product ID,Hardware Hash,Group Tag,Assigned User, no extra columns, no quotation marks, ANSI text rather than Unicode, case-sensitive headers, and at most 500 rows. Edit it in a plain-text editor such as Notepad; Microsoft warns that a file saved from Excel is not usable for the import. Leave Assigned User empty in this series: the user signs in during OOBE, and Microsoft warns that an invalid user principal name can leave the device inaccessible until the assignment is removed.

#Step 4: Understand the Microsoft Entra device object

When you register a Windows Autopilot device, the service automatically creates a Microsoft Entra device object for it. The deployment process uses that object to identify the device before anyone signs in, and the group tag you set is stored on it as OrderID. That is why Part 3’s dynamic group can find the laptop before it has ever been deployed.

Do not delete this object by hand. Microsoft says deleting it can make the device fail to enrol through Autopilot. Its stale-device guidance treats Autopilot devices as system-managed devices that should not be deleted, because once deleted they cannot be reprovisioned: a user-driven deployment then creates a new Entra device without the Autopilot identifier, and self-deploying and pre-provisioning deployments fail. Deleting an Entra device also deletes any BitLocker recovery keys stored on it, with no way to recover them. When a device really does leave the organisation, Microsoft’s order is to delete it from Intune first, then deregister it from Windows Autopilot in Intune; Part 6 walks through that.

The same object also explains a common surprise. The Windows Autopilot devices list is not the same as the Intune Windows devices list. A registered device appears under Windows devices only after registration succeeds and a licensed user signs in on it, which happens in Part 5.

#Check it worked

In Devices > Windows > Enrollment > Windows Autopilot > Devices, search for the pilot laptop’s serial number. It should be listed with the group tag AP-Pilot. Select it: the pane on the right shows its details, and lets you edit the device name, the group tag and, if a user is assigned, the username.

To confirm the Entra device object as well, run this read-only check from an admin workstation with the Microsoft Graph PowerShell SDK, replacing the serial number with your own:

1Connect-MgGraph -Scopes "DeviceManagementServiceConfig.Read.All","Device.Read.All"
2$ap = Get-MgDeviceManagementWindowsAutopilotDeviceIdentity -All | Where-Object SerialNumber -eq "YOUR-SERIAL"
3$ap | Select-Object SerialNumber, GroupTag, AzureActiveDirectoryDeviceId
4Get-MgDevice -Filter "deviceId eq '$($ap.AzureActiveDirectoryDeviceId)'" | Select-Object DisplayName, DeviceId

If prompted, consent to the two read permissions. The first query lists the serial number, AP-Pilot and a device ID; the second returns the Entra device with that ID. Microsoft marks the azureActiveDirectoryDeviceId property as due for deprecation, so if it comes back empty, rely on the Intune check above. Read the object, and leave it in place.

#If it didn’t

Common registration problems and what to do
What you seeLikely causeWhat to do
ZtdDeviceAlreadyAssignedThe device is already registered to your tenantSearch for its serial number under Windows Autopilot devices; if it is there, do not import it again
ZtdDeviceAssignedToAnotherTenantThe hash matches a device registered to another tenantDo not import it again; whoever registered it there, another organisation or your supplier, has to release it, and Microsoft’s guidance on transferring Autopilot devices between tenants covers how
InvalidZtdHardwareHashFields in the hash are invalid or empty; both the manufacturer and the serial number must be presentRun Get-CimInstance Win32_BaseBoard | Select-Object Manufacturer, SerialNumber on the device to check both are reported
The import fails or reads the wrong columnsThe CSV was saved from Excel, or has quotes, extra columns or changed headersRecapture it with the script, or fix it in Notepad
The device is listed without a group tag-GroupTag was left offSelect the device and set Group tag to AP-Pilot in its pane; no reimport is needed

#Ready for Part 3: assigning a deployment profile

The pilot laptop is now registered in Windows Autopilot with the group tag AP-Pilot, it is listed under Windows Autopilot devices in Intune, and its Microsoft Entra device object exists and stays where it is. It still has no deployment profile, so keep it switched off for now. Part 3 creates a dynamic device group that matches AP-Pilot through the device’s OrderID, assigns a user-driven, Microsoft Entra join deployment profile to that group, and waits until the laptop’s profile status reads Assigned.

About this page

Credited to

Dates

Published

Sources

This page lists no external sources.

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Series navigation
Part 2 of 6 in Windows Autopilot with Intune, Step by Step
View full series
Reader Interaction

Comments

Add a thoughtful note on Part 2: Register Devices in Windows Autopilot: Import Hardware Hashes into Intune. Comments are checked for spam and held for moderation before appearing.

Loading comments...

Discover more

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Engineering insights, direct to you.

Receive the latest Systems Engineering tutorials, production guides, Engineering Labs and operational best practices.