question

OSD-4642 avatar image
0 Votes"
OSD-4642 asked OSD-4642 commented

Unable to retreive device hardware hash >> windows autopilot csv

Hi,
Have been collecting hardware hash from years without issue.
Today encounter this issue that hardware hash can not be collected, anyone has ever experienced this?

197366-image.png


windows-10-generalwindows-server-powershellwindows-11windows-10-security
image.png (131.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
1 Vote"
RichMatheisen-8856 answered RichMatheisen-8856 commented

You have the source code for that script. If not, it's here: Get-WindowsAutoPilotInfo.ps1

Line 211 looks like this:

 $devDetail = (Get-CimInstance -CimSession $session -Namespace root/cimv2/mdm/dmmap -Class MDM_DevDetail_Ext01 -Filter "InstanceID='Ext' AND ParentID='./DevDetail'")

Assuming you're running it using to get data from "localhost", the CIM session is created like this (on line 199):

 $session = New-CimSession


· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
YES, I have source code that looks like following but it didn't worked.
197492-image.png
$wmi = Get-WMIObject -Namespace root/cimv2/mdm/dmmap -Class MDM_DevDetail_Ext01 -Filter “InstanceID=’Ext’ AND ParentID=’./DevDetail'”
$wmi.DeviceHardwareData | Out-File “$($env:COMPUTERNAME).txt”

Your code also shows the following error:
197513-image.png


0 Votes 0 ·
image.png (29.6 KiB)
image.png (22.2 KiB)

It's not MY code. That was taken right from the link to the source in my post.

Run the $session = New-CimSession before you run the $devDetail = (Get-CimInstance -CimSession $session -Namespace root/cimv2/mdm/dmmap -Class MDM_DevDetail_Ext01 -Filter "InstanceID='Ext' AND ParentID='./DevDetail'")

I see the code you posed used Get-WmiObject and not Get-CimInstance. Maybe (I don't know) a more recent version of the script should be used?

This is probably something you should take up with the author of the 3rd-party script?




1 Vote 1 ·
OSD-4642 avatar image OSD-4642 RichMatheisen-8856 ·

Thanks for reply.

Are you able to get hash code on your machine with the following?

197583-image.png


0 Votes 0 ·
image.png (8.0 KiB)
Show more comments
LimitlessTechnology-2700 avatar image
1 Vote"
LimitlessTechnology-2700 answered OSD-4642 commented

Hi there,

There are many ways to correct hardware harsh.The following methods are available to harvest a hardware hash from existing devices:

-Using Microsoft Endpoint Configuration Manager
-Using Windows PowerShell
-During OOBE by using the Diagnostics Page (Windows 11 only)
-From the Desktop using Settings > Accounts

You can try an alternate script from the below thread and see if that helps.
How to get hardware hash by all version of windows which support PowerShell https://answers.microsoft.com/en-us/windows/forum/all/how-to-get-hardware-hash-by-all-version-of-windows/14355e5b-cdab-4456-b376-ddf616220e4c


--If the reply is helpful, please Upvote and Accept it as an answer--

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you elaborate how we can get hardware hash using
From the Desktop using Settings > Accounts

The link you mentioned is the same procedure I am working with PS script.

0 Votes 0 ·