Open kevinh-csalabs opened 2 years ago
It currently already uses WMIC to retrieve the value. It gets it from WMIC BASEBOARD GET. It uses that, because when I triple-boot my mac, with MacOS, Windows, and linux, this value returned from this field matches the field returned from DMI in linux and IOPlatformSerialNumber in MacOS. I can do some more testing to see which values the one you specified matches with in macOS and Linux.
@krayon007
Ok, so I can confirm some models are returning motherboard information or other data instead of serialnumber, even though it is under a serial number column. Here is an example from an HP Pavilion - 15-cs0058od:
I'm seeing this with Lenovo Think Pad T460s as well:
(Serial number should start with "PC")
Unofficially Microsoft suggests using the wmic bios for this, though I have seen it come back blank before. https://support.microsoft.com/en-us/topic/how-to-find-computer-serial-number-7ceeffe0-1028-840e-dce9-d41634d54cff
Known issue from Lenovo (suggests patching bios, but not always feasible remotely: https://support.lenovo.com/us/en/solutions/ht503734-incorrect-serial-number-reported-when-running-wmic-command-lenovo-v510-14ikb15ikb
Ok, I have a few Lenovo Laptops, so I can check this out, and see if there's a way to determine at run time which field to use.
Thanks Bryan! We have a few Lenovos that are reporting correctly and most HP are correct, but some are wrong, so it seems to be a mixed bag.
We've noticed that Lenovo devices (and possibly others) report incorrect serial number information.
I haven't looked into how this is retrieved, but the values returned via "wmic bios get serialnumber" is correct. Can that be used for querying with the current method as a fallback since the wmic data seems to be more reliable?