views:

72

answers:

2

I want to retrieve the unique ID of a machine.

Like others I also did a lot research, and found none of the process of Unique ID generation works perfectly.

For Motherboard Serial Number (ID): It is Unique; it cant be changed. However, it may not be found in some machines if Manufactures didn't put information on Memory Location. Then I found it gives no Unique Id .. lol

Similarly for "Processor ID", "BIOS ID".

Afraid to use other hardware information of PC.

MAC and Windows Product ID can be changed by Software.

And Is "Windows Product ID" Unique?

One option is there to combine those but what if combination is not unique if above conditions applied?

Any other way to find the Unique ID of a machine?


Edit: I want to generate serial key based on that unique ID for software piracy protection. Machine means target PC I've to install software. @Guge: Thanks for mentioning.

+1  A: 

the Unique ID of a machine?

There is no such thing as "The Unique ID of a machine", as you have found.

You need to define your requirements, and use an ID (possibly allocated by yourself) that meets those requirements. E.g. for a web app, a cookie with a GUID might be sufficient to distinguish otherwise anonymous users (the small number of users who use multiple browsers or "in private" mode can be ignored).

For systems management assigning a GUID at the system level should be enough (multiple OS installs with multi-boot need to be tracked separately anyway).

...

Richard
+2  A: 

Because some of these IDs might be missing and users can swap out components you need to decide what you mean by "a machine".

For example, I'd look at motherboard id, processor id and bios id as these are the least likely to change. Then I'd look for all three and allow one to be missing and/or changed since the last time. If those conditions are met then allow the software to run.

What you do if two or even all three are missing I don't know, because, as you say, other things like MAC address can be changed by software and hard disk ID probably isn't unique and subject to more frequent change.

ChrisF