How-to · Intune

Export an Autopilot hardware hash and import it into Intune

At the end the device's hardware hash will be registered in Windows Autopilot in your Intune tenant, ready for a deployment profile, either uploaded directly or imported from a CSV.

Updated 4 Nov 20267 steps2 official sources
Before you start

What you need before step 1

Applies to: Windows 11 and Windows 10 devices registered manually with Windows Autopilot in Microsoft Intune (as documented, Microsoft Learn page updated 29 October 2026).

Admin roles you need

  • Intune Administrator or Policy and Profile Manager in Intune (or a custom RBAC role with the Enrollment programs permissions)
  • For the -Online upload: an account that is at least an Intune Administrator, with consent granted to the Microsoft Intune PowerShell and Microsoft Graph PowerShell enterprise applications
  • Local administrator on the Windows device, to run the script

Licences

  • An Intune subscription and Microsoft Entra ID P1 or P2. Windows automatic enrolment must be enabled.

Download

Get-WindowsAutopilotInfo script (PowerShell Gallery)Installed on the device with Install-Script. Author: Windows Autopilot.https://www.powershellgallery.com/packages/get-windowsautopilotinfoDownload

Web portals you will use (nothing to install)

Microsoft Intune admin centerBrowser-based, works on Windows and macOS. Used to import the CSV.https://intune.microsoft.comOpen

Also have ready

  • Internet access from the device to the PowerShell Gallery (and to Microsoft Entra ID for -Online).
  • For many devices: a USB drive or network share to collect the CSV files.
  • A plain-text editor such as Notepad to combine CSV files. Microsoft says not to use Excel, because files saved from Excel do not import.
  • The script runs on the Windows device being registered. There is no macOS route because Autopilot registers Windows devices.
Step by step

7 steps

  1. 1

    Open an elevated PowerShell on the device

    Where: The Windows device: Start > type PowerShell > right-click Windows PowerShell > Run as administrator

    On a device that has finished setup, open Windows PowerShell as administrator. On a new device still at the out-of-box experience (OOBE), press Shift+F10 at the sign-in prompt to open Command Prompt, then type powershell.exe and press Enter.

    powershell.exe
    You should see: A PowerShell prompt starting with PS C:\ (from OOBE it may start in C:\Windows\System32).
  2. 2

    Install the Get-WindowsAutopilotInfo script

    Where: The elevated PowerShell window on the device

    Enable TLS 1.2, create a working folder, add the scripts folder to the path, allow the script for this session only, and install it from the PowerShell Gallery. If prompted to install NuGet from PSGallery, type Y.

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    New-Item -Type Directory -Path "C:\HWID"
    Set-Location -Path "C:\HWID"
    $env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"
    Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
    Install-Script -Name Get-WindowsAutopilotInfo
    You should see: The prompt returns without errors and the script is installed.
  3. 3

    Option A: save the hash to a CSV

    Where: The elevated PowerShell window, in C:\HWID

    Run the script with -OutputFile. Copy C:\HWID\AutopilotHWID.csv to a USB drive or share. Add -Append with the same file name when collecting several devices into one file.

    Get-WindowsAutopilotInfo -OutputFile AutopilotHWID.csv
    You should see: C:\HWID\AutopilotHWID.csv exists and contains a header line and one device line.
  4. 4

    Option B: upload the hash straight to Intune

    Where: The elevated PowerShell window on the device

    Skip the CSV and upload directly. A Microsoft Entra sign-in prompt appears; sign in with an account that is at least an Intune Administrator. You can add -GroupTag to tag the device.

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
    Install-Script -Name Get-WindowsAutopilotInfo -Force
    Get-WindowsAutopilotInfo -Online
    You should see: After sign-in the script reports the device was imported. Skip to the Sync step.
  5. 5

    Check and combine the CSV

    Where: Notepad on your admin PC

    Open the CSV in Notepad. The header must be exactly as below (headers are case-sensitive). Serial number and hardware hash are required; product ID, group tag and assigned user are optional. Do not add columns or quotation marks, save as ANSI (not Unicode), and keep each file to 500 device rows or fewer.

    Device Serial Number,Windows Product ID,Hardware Hash,Group Tag,Assigned User
    <serialNumber>,<ProductID>,<hardwareHash>,<optionalGroupTag>,<optionalAssignedUser>
    You should see: One header line, then one line per device, saved as ANSI text.
  6. 6

    Import the CSV into Intune

    Where: Microsoft Intune admin center > Devices > Windows > Enrollment > Windows Autopilot > Devices

    Sign in at https://intune.microsoft.com. Select Devices, under By platform select Windows, under Device onboarding select Enrollment, then under Windows Autopilot select Devices. In the toolbar select Import, browse to the CSV and select Import.

    You should see: Intune shows the import is in progress. It can take several minutes.
  7. 7

    Sync and refresh

    Where: Microsoft Intune admin center > Windows Autopilot devices

    When the import finishes, select Sync in the toolbar, then select Refresh until the devices appear.

    You should see: A message says synchronisation is in progress, then the devices appear in the list by serial number.
From experience

Expert tips

Use -Online for a handful, CSV for a fleet

Get-WindowsAutopilotInfo -Online is fastest for a few devices because it skips the import step, but it needs an Intune Administrator sign-in on each device. For many devices, collect a CSV per device (or use -Append to one file on a USB drive) and import once. Add -GroupTag during capture so devices are tagged for profile targeting from the start.

No network at OOBE? Use the diagnostics export

On Windows 11, press Ctrl+Shift+D during OOBE to open the Diagnostics page and export logs to USB; Microsoft says the logs include a CSV with the hardware hash. That avoids needing PowerShell Gallery access on a device that is not yet set up.

Edit CSVs in Notepad only

Microsoft states files saved from Excel do not import. Keep the exact case-sensitive header, no extra columns or quotation marks, ANSI encoding and no more than 500 device rows per file. When combining files, keep one header line at the top and delete the others.

Tenant-to-tenant: deregister in the old tenant first

A device registered elsewhere fails with ZtdDeviceAssignedToAnotherTenant. Have the old tenant (or the reseller) delete the device from Windows Autopilot, Intune and Microsoft Entra ID in the documented order before you import it. Allow for this in the schedule, because you depend on the other party.

Check the profile is assigned before you reset

After import, select Sync and confirm the device shows its deployment profile as assigned. Resetting a device before that leaves it at a standard OOBE without your branding or settings, and you will reset it again.

Check it worked

How to confirm it worked

  • In Windows Autopilot devices, search for the device's serial number and confirm it is listed (with the group tag if you set one).

  • On the device, compare the serial number shown in Intune with Get-CimInstance Win32_BIOS | Select-Object SerialNumber.

  • After you assign a deployment profile, check the device shows the profile as assigned before you reset or start OOBE.

Undo

How to reverse it

Rollback:

In Windows Autopilot devices, select the device and select Delete in the toolbar; this works for devices not enrolled in Intune. To remove a device from a tenant completely, Microsoft says to delete its records in Intune, Microsoft Entra ID and Windows Autopilot in the documented order on the Deregister a device page. Do this before moving a device to another tenant.

Troubleshooting

Errors you might see

ZtdDeviceAssignedToAnotherTenant

Cause: The hardware hash matches a device already registered to a different tenant.

Fix: Have the other tenant (or the reseller who registered it) deregister the device, then import again.

ZtdDeviceAlreadyAssigned

Cause: The device is already registered in your tenant.

Fix: Check Windows Autopilot devices for the serial number. If it is not there, import again.

ZtdDeviceDuplicated

Cause: The CSV contains the same hardware hash more than once.

Fix: Only one copy is processed. Remove the duplicates from the file.

InvalidZtdHardwareHash

Cause: One or more fields in the hash are invalid or empty, often missing manufacturer or serial number.

Fix: Check with Get-CimInstance Win32_BaseBoard | Select-Object Manufacturer, SerialNumber and recapture the hash.

StorageError

Cause: A generic service error.

Fix: Try again later. If it persists, contact Microsoft support.

FAQ

Questions

Can I get the hash without PowerShell?

On Windows 11, press Ctrl+Shift+D during OOBE to open the Diagnostics page and export logs to a USB drive; the logs include a CSV with the hardware hash.

Do I need the Windows Product ID?

No for admins. Microsoft lists it as required only for partners.

How many devices can one CSV hold?

Up to 500 device rows per file.

Why does my CSV fail to import after editing?

Microsoft states files saved from Excel do not import. Edit in Notepad, keep the exact headers and save as ANSI.

Sources

Official sources

Vendors change menus and requirements. Confirm on the source before you rely on a detail. Last checked 4 Nov 2026.