Table of Contents
Here is a step-by-step guide on gathering the HardwareID used for Microsoft Intune Autopilot. It covers both manual convention and a semi-automatic method with an online function.
1. Gathering Hardware IDs
The hardware IDs of devices can be gathered using PowerShell and the ‘Get-WindowsAutoPilotInfo’ cmdlet.
a. HardwareID Pre-requisites – Install Module
For this stage ensure you have an active internet connection on the device, as this will download the required module from Online.
- Open PowerShell as an administrator.
- Install the WindowsAutoPilotIntune module if you haven’t done so already, using the command:
Install-Script -Name Get-WindowsAutoPilotInfo -Force
- Agree to NuGet provider is required to continue:
b. HardwareID – Online Method
-Online parameter automatically uploads the device information to Intune.
- Run the command:
Get-WindowsAutoPilotInfo -Online, which will gather the hardware ID and other device information and upload it directly to Intune.
Please note that the
-Online parameter for the
Get-WindowsAutoPilotInfo cmdlet requires the user to be a Global Administrator or Intune Service Administrator in Azure Active Directory and requires permissions to update properties of the Windows autopilot deployment program in Intune. The offline method does not require these permissions, which makes it useful for IT support staff and consultants who don’t have administrative access.
c. HardwareID – Offline Method
If you want to manually upload the data to Intune at a later time, you can use the offline method.
- Open PowerShell as an administrator.
Get-WindowsAutopilotInfo.ps1 -OutputFile AutoPilotHWID.csv
This will save the hardware IDs and other device information to a CSV file named ‘AutoPilotHWID.csv’.
- If no file path is specified, the CSV file can be found in the directory where you ran the PowerShell script.
In addition to these methods, you can also gather hardware IDs using the ‘Windows Configuration Designer’ app and from OEMs. For the former, you will have to create a provisioning package and for the latter, you can request a hardware ID file from the OEM.
2. Uploading Hardware IDs to Intune
After obtaining the CSV file, you can manually upload it to Intune.
- Sign into the Microsoft Endpoint Manager admin center.
- Select ‘Devices’ > ‘Enroll devices’.
- In the ‘Windows Autopilot Deployment Program’ section, select ‘Devices’.
- Select ‘Import’ to start the import process.
- On the ‘Add Windows Autopilot devices’ pane, browse to the CSV file that you created earlier, then select ‘Open’ > ‘Import’.
3. Script Location
Get-WindowsAutoPilotInfo.ps1 script is part of the WindowsAutoPilotIntune PowerShell module, which can be installed from the PowerShell Gallery.
a. Get-WindowsAutopilotInfo Parameters Breakdown (Version 3.8)
Here’s a detailed explanation of the parameters for the
Get-WindowsAutopilotInfo script in version 3.8:
Name <String>– Specifies the names of the computers. These can be provided via the pipeline (property name Name or one of the available aliases: DNSHostName, ComputerName, and Computer).
OutputFile <String>– Sets the name of the CSV file to be created with the details for the computers. If not specified, the details will be returned to the PowerShell pipeline.
Append <SwitchParameter>– An optional switch that indicates new computer details should be appended to the specified output file, instead of overwriting the existing file.
Credential <PSCredential>– Determines the credentials that should be used when connecting to a remote computer (not supported when gathering details from the local computer).
Partner <SwitchParameter>– An optional switch that specifies that the created CSV file should use the schema for Partner Center (using serial number, make, and model).
GroupTag <String>– Provides an optional tag value that should be included in a CSV file that is intended to be uploaded via Intune (not supported by Partner Center or Microsoft Store for Business).
AssignedUser <String>– Specifies an optional value indicating the UPN of the user to be assigned to the device. This can only be specified for Intune (not supported by Partner Center or Microsoft Store for Business).
Online <SwitchParameter> -This parameter is used to add computers to Windows Autopilot.
AddToGroup <String>: This parameter allows you to add the device to a specific Autopilot deployment group.
Force <SwitchParameter>: This is a switch parameter that forces the script to run without asking for user confirmation.
here’s an example of a PowerShell execution that uses the
# Example usage
Get-WindowsAutopilotInfo -Name "ComputerName" -GroupTag "Group1" -Online -Append