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.

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.
Table of Contents
Table of contents
Continue the series
You are reading Part 2 of 6
Windows Autopilot with Intune, Step by Step
#What this part does
To register a device with Windows AutopilotThe KBY LexiconWindows AutopilotWindows Autopilot registers device hardware identity to a tenant so new or reset Windows devices self-configure via Entra ID join and Intune policy during first boot.
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 IDThe KBY LexiconMicrosoft Entra IDA concise technical definition of Microsoft Entra ID: what it is, how it fits identity architecture, and where engineers must validate before change.
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 IntuneThe KBY LexiconMicrosoft IntuneMicrosoft Intune is Microsoft's cloud-based unified endpoint management service for enrolling, configuring, securing and retiring Windows, macOS, iOS and Android devices. 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:
| Route | Who does it | What it needs |
|---|---|---|
| Manufacturer (OEM) | The manufacturer, on your behalf | A Global Administrator approves the OEM first; the OEM writes to the Autopilot service, not to your tenant |
| Reseller, distributor or CSP partner | The partner, in Partner Center | A 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 |
| Manual | You, in Intune | A 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-PilotThis 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-PilotThe 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
- Sign in to the Microsoft Intune admin centre.
- Go to Devices > Windows, then under Device onboarding select Enrollment.
- Under Windows Autopilot, select Devices.
- Select Import, browse to
AutopilotHWID.csvand select Import. The import can take several minutes. - 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, DeviceIdIf 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
| What you see | Likely cause | What to do |
|---|---|---|
ZtdDeviceAlreadyAssigned | The device is already registered to your tenant | Search for its serial number under Windows Autopilot devices; if it is there, do not import it again |
ZtdDeviceAssignedToAnotherTenant | The hash matches a device registered to another tenant | Do 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 |
InvalidZtdHardwareHash | Fields in the hash are invalid or empty; both the manufacturer and the serial number must be present | Run Get-CimInstance Win32_BaseBoard | Select-Object Manufacturer, SerialNumber on the device to check both are reported |
| The import fails or reads the wrong columns | The CSV was saved from Excel, or has quotes, extra columns or changed headers | Recapture it with the script, or fix it in Notepad |
| The device is listed without a group tag | -GroupTag was left off | Select 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.
#Related reading
Part 1: Windows Autopilot Prerequisites in Intune: Licences, Automatic Enrolment and Branding
Decommissioning Windows Devices in Intune: Retire, Wipe, Cleanup
Run Intune Remediations On Demand to Fix One Windows Device Without Waiting
Route Windows Autopilot Profiles With Group Tags and Dynamic Device Groups
About this page
Credited to
Dates
Published
Sources
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Read-only scripts
- Windows devices with no BitLocker recovery key in Entra IDMicrosoft Entra ID, Windows
- Intune devices that haven't synced in N daysMicrosoft Intune
- Mailboxes forwarding to external addressesExchange Online
- BitLocker status of every volume on this PCWindows
Upcoming deadlines
- Intune moves to macOS 15 and laterQ4 2026
- SAP SuccessFactors provisioning: move from basic auth to workload identityNovember 2026
- Intune November release: JIT registration reminder at APNs renewal and automatic JIT for eligible tenantsNovember 2026
Explore KBY
The KBY Brief
A short email about twice a week with new runbooks, configuration traps and fixes from KBY Technologies.
SubscribeRelated Engineering Labs
Review
Port Lookup
Search ports and protocols for common infrastructure services, plus the network requirements for Intune, Autopilot, Apple push notifications and Entra Connect, with copy-ready firewall rules.
Simulator
Intune Assignments
Check whether a user and device receive an Intune app or policy: group include and exclude rules, assignment filters in include or exclude mode, and app intent conflicts.
Calculator
Apple Update Dates
Work out when an iOS or macOS update becomes visible under a Declarative Device Management or legacy deferral, and when a DDM enforcement deadline forces the install.
Related articles
Enterprise IT Management
Part 1: Windows Autopilot Prerequisites in Intune: Licences, Automatic Enrolment and Branding
Get the tenant ready for Windows Autopilot: licences, automatic Intune enrolment for a pilot group, Entra join permissions, branding, and the choice between classic Autopilot and device preparation.
Enterprise IT Management
Microsoft 365 Group Expiration Policy: Staged Rollout, Renewal and Restore
How to enable Microsoft 365 group expiration without a deletion wave: capture the policy, close ownership gaps, pilot on selected groups, widen to all, verify dates, and switch off and restore safely.
Enterprise IT Management
Scope Microsoft Graph Mail Access to Specific Mailboxes with Exchange Online RBAC for Applications
Scope an app's Graph mail access to specific mailboxes with RBAC for Applications in Exchange Online, test it, remove the unscoped Entra grant and keep a tested rollback.
Enterprise IT Management
Restricting Microsoft 365 Group Creation to an Approved Security Group
How to limit Microsoft 365 Group creation to one approved security group with the Group.Unified directory setting, including state capture, validation from both sides, failure modes and a tested rollback.
Discover more
Graduate Learning
Ops Playbook
- PlaybookRun Intune Remediations On Demand to Fix One Windows Device Without Waiting
- PlaybookRoute Windows Autopilot Profiles With Group Tags and Dynamic Device Groups
- PlaybookIntune Endpoint Analytics Devices Missing Startup Performance Scores
- PlaybookIntune Remediation Script Shows Without Issues but Never Runs
Lexicon Definitions
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.
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.