Search This Blog

Sunday, September 17, 2023

Hardware: Finding device info using PowerShell

The hunt for more information began with a new keyboard I have. A wireless keyboard called "Deltaco TB-632". As an avid Deltaco fan I also knew that they rarely make their own products, but they rebrand devices that they source from other companies.

One example is their smart home devices that in at least one case seems to come from China.

So how did I go about finding more information about this keyboard? Well, old trusty PowerShell of course. After first trying to find a way using the control panel and settings to see a MAC address or other identifying information I simply turned to the command Get-Pnpdevice.

If you run this command you will discover practically all devices that has been connected to the computer since the last OS installation. They will be listed as Unknown if they aren't connected and OK if they are working fine.

This is the main code I ran: get-pnpdevice -Class USB | Select-Object status, friendlyname, instanceid | Sort-Object -Property friendlyname

First I ran the command without the USB wireless receiver attached.

Then I attached the receiver and ran the command again. By doing this I could see which device that turned from Unknown to OK.

In this specific case I got a result looking like this:

OK USB Composite Device USB\VID_248A&PID_8367\5&194485C0&0&1

Now that you have the VID (vendor ID) and PID (device ID) for your device you can simply Google these identifiers.

My result indicated that the Deltaco TB-632 seems to be provided by the company Maxxter and the USB device is called Telink Wireless Receiver.

Using the same method I tried looking for the keyboard unit itself as well in the list of PnP devices. I tested this theory by running the following command without and with the device plugged in.

(get-pnpdevice -Status OK).Count



The result was that 8 devices appeared when the receiver was plugged in.

To find out which devices that make up the difference you can combine Get-Pnpdevice with Compare-Object. Adapt the code after your individual situation.

First run this code with the device in:
 get-pnpdevice -Status OK | Sort-Object ClassGuid | Out-file -FilePath C:\temp\dev1.txt

Then run this code with the device out:
get-pnpdevice -Status OK | Sort-Object ClassGuid | Out-file -FilePath C:\temp\dev2.txt

To then compare the output run this comand:

Compare-Object -ReferenceObject (Get-content -path C:\temp\dev1.txt) -DifferenceObject (Get-Content -Path C:\temp\dev2.txt)

The output will look like this, the arrow shows that the result is present in the reference object, which in this case was to the left and missing in the difference object to the right, which means that they disappeared when we unplugged the device.


From here you can then investigate further from the VID and PID that you get.

Happy hunting :-)


No comments:

Post a Comment