Extract HWID from Windows Autopilot devices
Extract HWID from Windows Autopilot devices in intune and want to extract the HWID of each machine?
There is no built-in feature for doing this, a export from Intune Windows Autopilot devices will only generate rudimentary information about the device such as Manufacturer, Model, Group tag and so on.
THIS is not the export we are looking for..

Where are the HWIDs for the machines?
Lets utilize this to deploy a small PowerShell script that extracts the HWID from each machine and uploads it to a Azure Blob storage.
The Script:
#=========================
#Sets Hash Directory and Generates Hardware Hash file
#=========================
$CSVPath = new-item -Path "c:\" -Name "HWID" -ItemType Directory -Force
$serialnumber = Get-WmiObject win32_bios | select Serialnumber
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Script -Name Get-WindowsAutoPilotInfo -Force
Set-ExecutionPolicy Unrestricted -Force
Get-WindowsAutoPilotInfo -Outputfile $CSVPath\$($serialnumber.SerialNumber)-hwid.csv
#===========================
#Download and Extract AZCopy
#===========================
$downloadsource = 'https://aka.ms/downloadazcopy-v10-windows'
$filename = "azcopy.zip"
Start-BitsTransfer -Source $downloadsource -Destination $CSVPath\$filename | Out-Null
Expand-Archive -LiteralPath $CSVPath\azcopy.zip -DestinationPath $CSVPath -Force
Move-Item -Path $CSVPath\azcopy_windows_amd64_10.18.0\azcopy.exe -Destination $CSVPath
CD $CSVPath
#=========================
#Upload to Blob
#=========================
#Hash File:
$file = "$CSVPath\$($serialnumber.SerialNumber)-hwid.csv"
#Storage Account SAS URL
$sasurl = "*your blob url and SAS key (read & write permissions)"
#Copy File
.\azcopy.exe copy $file $sasurl | Out-Null
Deploy it in Intune as and run in system system context and let the machines do the magic of automatically uploading the HWID to a central location and now you can, like in my case import them to the new tenant.