Skip to main content

Collecting and Importing Autopilot Device Hashes


Purpose

This procedure provides a standardized method for collecting Autopilot hardware IDs (HWIDs) and associated Group Tags from new devices, consolidating the data, and importing it into Microsoft Intune to register the devices for Autopilot deployment.


Scope

This procedure applies to IT administrators and technicians responsible for onboarding new Windows devices into Microsoft Endpoint Manager (Intune) for Autopilot deployment.


Prerequisites

Before proceeding, ensure you have:

  • A basic understanding of Windows Autopilot.
  • Access permissions to a designated network file share.
  • Permissions to import Autopilot devices in the Intune portal.

Procedure and Guidelines

Step 1: Gather Autopilot Hardware ID and Group Tag on a Device

Purpose: To run a script on a new device that captures its hardware hash and assigns a Group Tag, saving the output to a local CSV file.

Script:

# Ensure Tls12 is used for secure connections
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

# Create the HWID directory if it doesn't exist
New-Item -Type Directory -Path "C:\HWID" -Force
Set-Location -Path "C:\HWID"

# Install the Get-WindowsAutopilotInfo script if it's not already installed
Install-Script -Name Get-WindowsAutopilotInfo -Force

# --- CONFIGURATION ---
# Specify the group tag (e.g., CLBA_USER_LAB123)
$groupTag = "YOUR_GROUP_TAG"
# --- END CONFIGURATION ---

# Retrieve the serial number of the device for a unique filename
$serialNumber = (Get-WmiObject -Class Win32_Bios).SerialNumber

# Specify the output file path
$outputFile = "C:\HWID\AutopilotInfo_${serialNumber}.csv"

# Run the Get-WindowsAutopilotInfo cmdlet
Get-WindowsAutopilotInfo -OutputFile $outputFile -GroupTag $groupTag

Write-Host "Autopilot information has been saved to: $outputFile"

Step 2: Transfer CSV Files to a Central Network Share

Purpose: To move all locally generated HWID CSV files to a single, accessible network location for consolidation.

Script:

# --- CONFIGURATION ---
$sourceFolder = "C:\HWID"
$destinationFolder = "\\your-server\your-share\hash-store"
# --- END CONFIGURATION ---

# Copy files
Get-ChildItem -Path $sourceFolder -Filter "*.csv" | ForEach-Object {
Copy-Item -Path $_.FullName -Destination $destinationFolder -Force
Write-Host "Copied $($_.Name) to $destinationFolder"
}

Step 3: Combine Individual CSV Files into a Single Hash File

Purpose: To merge all individual HWID CSV files from the network share into one master CSV file for upload to Intune. This script should be run from a machine with access to the share.

Script:

Param(
[String]$HashFilesPath = "\\your-server\your-share\hash-store"
)

# Consolidate CSV files
Get-ChildItem -Path $HashFilesPath -Filter "AutopilotInfo_*.csv" |
Select-Object -ExpandProperty FullName |
Import-Csv |
Export-Csv -Path "$HashFilesPath\CombinedHashes_$(Get-Date -f yyyy-MM-dd).csv" -NoTypeInformation -Force

Write-Host "All hash files have been combined into a new dated CombinedHashes CSV file in the same directory."

Step 4: Upload the Consolidated Hash File into Intune

  1. Log in to the Microsoft Intune admin center.
  2. Navigate to: Devices > Windows > Windows enrollment.
  3. In the "Windows Autopilot Deployment Program" section, select Devices.
  4. Click Import.
  5. In the flyout pane, browse to and select your consolidated CSV file (e.g., CombinedHashes_2024-01-01.csv).
  6. Click Import and monitor the process.

Naming Schemes and Group Tag Integration

Group tags are essential for automating device management in Intune.

Group Tag Naming Convention

  • Format: {Unit FAMIS Code}_{Denotation}_{Identifier}
  • Key Rules: Use underscores (_) as separators. Begin with the unit's FAMIS code.
  • Examples: CLBA_ACCT_LAB449, CLVM_SHARED_PRE, ENGR_USER_STAFF