Get Unique IDper Machine

  • Thread starter Alhambra Eidos Desarrollo
  • Start date
A

Alhambra Eidos Desarrollo

Hi,

I've been working on this too. I needed to get a unique ID per machine that
can't be changed.
I tried the CPUID, But it's not Unique. The MAC can be changed.
The CPU Serial was good, but as I have read on the web, it's not there
anymore after P3.

The Motherboard Serial Number seems fine. Here is the way:


/// /// Return the serial number of the motherboard/// /// [string] SN of
motherboardpublic static string GetMBSN(){ //Getting list of
motherboards ManagementObjectCollection mbCol = new
ManagementClass("Win32_BaseBoard").GetInstances(); //Enumerating
the list ManagementObjectCollection.ManagementObjectEnumerator
mbEnum = mbCol.GetEnumerator(); //Move the cursor to the first
element of the list (and most probably the only one)
mbEnum.MoveNext(); //Getting the serial number of that specific
motherboard return
((ManagementObject)(mbEnum.Current)).Properties["SerialNumber"].Value.ToString();}

The code above was inspired from:
- http://www.eggheadcafe.com/articles/20030511.asp
- http://bytes.com/forum/thread236091.html

Reliably identifying a given system is fraught with danger.

MAC addresses are unreliable for system ID. Even if the system contains one
or more NICs, if ALL of the NICs are disabled, you won't be able to retrieve
any MAC address. Besides that, they can be changed by the user.

The Win32_BaseBoard class contains the serial number of the board, but if
the BIOS gets updated by the user, the chances are very good that the serial
number property will be empty or null (the same goes for the Win32_BIOS
class).

You also can't use Win32_ComputerSystemProduct class, because machines not
built by a retail system builder (like Dell, Acer, Toshiba, HP, etc) will
have a UUID of FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF.

I'm still looking for a reliable and repeatable way to identify a system.



any help, please ? thanks.
 
P

Peter Morris

I just use the serial number of the HD Windows is installed on. If they
replace that then they have to reinstall anyway so applying for a license
update isn't so bad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top