views:

26

answers:

1

I'm searching for some information regarding Win32_OperatingSystem SerialNumber (MSDN link).
Will this number be different when I reinstall Windows with the same key on the same machine?

I intend to use it to identify an installation (Windows + PC combination).

+1  A: 

I'm not so sure about the stability of Win32_OperatingSystem.SerialNumber... but I wouldn't recommend using it as your unique identifier.

To get the serial number that's burned into the computer's hardware--i.e. that never changes*--the method that I found after some research is this:

  1. Fetch Win32_BIOS.SerialNumber -- this should work for >90% of PCs/servers, including all the major manufacturers (HP, Dell, etc.).
  2. If that didn't work, then try Win32_BaseBoard.SerialNumber.
  3. Failing that, your last resort is Win32_ComputerSystemProduct.IdentifyingNumber.

*Note: technically, the serial number would change if the motherboard was replaced with a new one--thus the (new) burned-in S/N wouldn't match the labels on the case... but this is a rare/unusual exception.

ewall
Seems to work fine so far in my (limited) tests. Thanks!
Marc