How to get the Hash ID for device which is already added to intune.

Copper Contributor

HI, 

 

I have a device in my tenant, for which i need to find the Hash id. 

21 Replies

You can try to download the device hash in the Mem portal under devices > enroll devices > devices. There you can select the effected device and click the Export button.

Alternatively you can get the device hash directly on the device with the following command:
Get-WindowsAutoPilotInfo.ps1 -OutputFile AutoPilotHWID.csv

Exporting from Endpoint Manager doesn't include the actual hardware hash in the exported CSV file. There currently does not seem to be a way to export the hardware hash of an Autopilot device directly from Endpoint Manager.

Using the script locally on the device will of course work and retrieve the HW hash.
You could create a pro active remediation... the only bad about pro active remediaitons that its limited to 2046 characters. So...

-Create some pro active rem which exports the hash
-store the information in a sharepoint site like damien did: https://www.systanddeploy.com/2021/02/intune-troubleshooting-collect-remotely.html
-Make sure you clean up the intunem gt log like i showed
https://call4cloud.nl/2021/05/the-laps-reloaded/#third-part

You can also use the following command to only get the device hash to send it to a storage. Therefor you don't need install the Get-AutoPilotInfo script.

(Get-CimInstance -ClassName MDM_DevDetail_Ext01 -Namespace root\cimv2\mdm\dmmap).DeviceHardwareData

HI All,
Thanks for all your reply. I have found one way to find the Hash ID from the portal. i.e, Via Device diagnostic. Which will provide you a cab file with all the logs. In that you can find the HASH ID. I will post the exact file, folder and Path location ASAP.
Thanks & Regards,
Karthik Ajoy
Hu, but you need to do this for each device right? so if you have got like 200 devices from where you need to extract the hash... i guess that would take some time?
Hi @Rudy_Ooms_MVP, Yes you are right. this will help us to retrieve only one device at a time. This won't help you to get bulk one. At least one thing we have here is to retrieve hash from Console.

@karthikajoy 

 

can you please provide the exact file, folder, and Path location of HASH ID with in device diagnostics logs.

 

many thanks

why do you need the hash? is it to register it to autopilot? id so not needed - when assigning an Intune enrolled device to an existing or new autopilot profile it will automatically enroll / register this device to autopilot (just make sure to check the "Convert all targeted devices to Autopilot" option within your autopilot profile).

@giladkeidar 

we have some hybrid joined devices in Intune and would like to pull the hash IDs to deploy via autopilot

as I answered in my original post - "just make sure to check the "Convert all targeted devices to Autopilot" option within your autopilot profile" - it will add any device that is part of that profile as autopilot device.

@giladkeidar I have two tenant test and prod inside. I need the Hash ID for change b/w the tenants. 

try this
https://github.com/microsoftgraph/powershell-intune-samples/tree/8b4f760a460839de6ee1726c3159a484783...

but you might need to re format the csv before importing to your other tenant.

if you use SCCM you can do it there also
Hi,

Didnt knew the manageddevices graph uri shows the hardware HASH.. so far as I know it only shows hardware information and not the needed hash?
yes you are right, I forgot it doesn't give the actual hash - so I believe the only way is using the "WindowsAutoPilotInfo" PS module.

If all devices are already enrolled to Intune I believe you can deploy a script which will export those settings and upload the data to Sharepoint list or any other online storage.

Hi @karthikajoy 

 

Can you please share the steps you did to get HWID from Intune?

where is the csv then stored?

Collect the diagnostic logs, after it uploaded to Intune you can download and get the hashID from that zip file @Soutumi 

No need to question "why". I needed this for the same reason, to flip between 2 different tenants for test devices without having to find it physically. This solution works.
Within my DiagLogs, I found it in folder 46, in a CAB called mdmlogs-*. I extracted that and there is a CSV with the HashID inside.