3

Possible Duplicate:
Is there some uniqueID of each computer, to differentiate one from other?

For issuing licenses for a certain computer, what would be a good way to determine a unique, globally distinct computer (they will always run windows if that matters) based on their hardware.

There are already some answers to this question on stackoverflow but I have tested all the approaches across a wide range of computers and none of them really work.

What are common approaches to such hardware identification? How might Windows do it?

Here is what I tested using WMI:

CPU-ID as suggested here

It is the same to two identical computers

Harddrive Volumne-ID as suggested here or here

It is the same on a cloned drive (tested with Acronis TrueImage) image

Windows OS serial key

It is the same on a cloned drive image.

Motherboard serialnumer as suggested here

I have found some PCs where WMI does not return a serial number at all

Maybe WMI is not the right tool for the job? Is there another API somewhere out there that lest my query hardare details?

Community
  • 1
  • 1
bitbonk
  • 48,890
  • 37
  • 186
  • 278
  • Why are you voting to close this question? I linked to possible duplicates myself and stated why they don't answer my my question. – bitbonk Jul 08 '11 at 11:12
  • @bitbonk: Did you read http://stackoverflow.com/questions/99880/generating-a-unique-machine-id ? Do you need the unique machine to be tied to what components? If you deduct the ID from a number of components, updating one of those components would result in a different ID. – Răzvan Flavius Panda Jul 08 '11 at 11:28
  • Yes, I read that. Basically it should work the same way it does with windows licensing. If you modify too many components, you'll need a new license. Updating a driver or any bios does not qualify as a component change and should never require a new license. – bitbonk Jul 08 '11 at 11:31
  • 1
    @bitbonk: should the unique machine id be dependant only on hardware? i read windows has in registry a value that is resulted from a combination of at least some hardware identificators, but using that might be os dependant and there would probably be no way to know if only 1 component changed or the entire system – Răzvan Flavius Panda Jul 08 '11 at 11:46
  • @bitbonk: The initial version that I saw, and voted on was substantially sparser. Unfortunately there is no "remove close vote" option. – Binary Worrier Jul 08 '11 at 12:02
  • @Răzvan Panda: That registry key sounds interesting. But when I clone a drive image that key has to change when put on a diffrent machine with identical hardware. Do you know if that is the case? Dou you know the name of that key? – bitbonk Jul 08 '11 at 12:36
  • @bitbonk: this must be it http://www.eigo.co.uk/News-Article.aspx?NewsArticleID=63 – Răzvan Flavius Panda Jul 08 '11 at 12:44
  • @Răzvan Panda: I highly doubt that this key will differ if a cloned drive image will be written to multiple harddrives. As the athor writes: `In the Windows registry is a key called MachineGUID that has a UUID which is created by Windows during installation and should in theory be unique to the machine. In practice this is not the case and I have often come across duplicates ` – bitbonk Jul 08 '11 at 12:58
  • @bitbonk: I presume you will generate the key on instalation and store it. And from time to time(on application launch maybe) regenerate the key and compare it with the stored one to see if the current machine has changed. So if someone would make a cloned image the program will generate a new key and will know that the machine has changed. – Răzvan Flavius Panda Jul 08 '11 at 13:03
  • I can't use that registry key you mentioned then because that doen't change once it is created. – bitbonk Jul 08 '11 at 14:07

1 Answers1

0

This article describes how to create a Machine Universally Unique Identifier:

Creating a MachineGUID

One solution would be to combine as many of this ID's into one ID that has a much lower rate of being a duplicate:

  • CPU ID is unique to each processor type - can not be changed
  • Motherboard Serial Number is unique - can not be changed
  • MAC address(48 bit) should be unique but collisions can occur - can be changed
  • Harddrive serial should be unique but for each individual manufacturer - can be changed
Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
  • I am aware of these links but my WMI test seem to hint that these IDs are not at all unique. – bitbonk Jul 08 '11 at 11:03
  • I read your update, i will do some more research – Răzvan Flavius Panda Jul 08 '11 at 11:09
  • Two PCs with the same CPU type will have the same CPU ID, so I can't use it. Some motherbords do not have a serial number (or at leat WMI doesn't show it), so I can't use it (unless there is another way to get it). – bitbonk Jul 08 '11 at 12:45
  • You can add the CPU ID to a constructed Global ID since it will add extra information if the cpu happens to be different. And you can add the motherboard ID and any other ID that can exist or not depending on whether it exists or not. Basically the more static ID's(even non-universally unique ones) you add to a constructed Global ID the less the chance the Global ID's can collide. – Răzvan Flavius Panda Jul 08 '11 at 12:52