Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good unique PC identifier?

Tags:

c#

.net

guid

I've been looking at the code in this tutorial, and I found that it uses My.Computer.Name to save settings that shouldn't roam between computers. It's entirely possible, however, for a user to have two identically named PCs. If they wanted to have the same username on each PC, for example, they may very well end up with two PCs named Username-PC.

What are some good methods of identifying different PCs? Do PCs have GUIDs associated with them, or should I look into pulling the serial number off of some hardware? I don't care if the identification persists through reinstallation of Windows.

(The tutorial I linked is in VB.Net, but I'm implementing it in C#)

like image 721
dlras2 Avatar asked Aug 09 '10 18:08

dlras2


People also ask

What is the unique identifier for a PC?

A universally unique identifier (UUID) is a 128-bit label used for information in computer systems. The term globally unique identifier (GUID) is also used. When generated according to the standard methods, UUIDs are, for practical purposes, unique.

What is an example of a unique identifier?

Some agencies give people a 'unique identifier' instead of using their name. Examples are a driver's licence number, a passport number, a student ID number, or an IRD number.

What is a laptop unique identifier?

The SID (security identifier) is an identifier generated when you install windows. It is very unlikely that two computers will have the same SID. The SID was originally designed in order to identify users uniquely across a network.


2 Answers

Some good identifiers:

  • MAC Address: It's fairly easy to get at, and it's usually unique. However, it can be spoofed/changed rather easily, so it depends on how unique it needs to be.
  • CPU Serial Number: It's not available on lots of older systems, but it's there. Check out this MSDN page. It won't change, but it's bound to a computer.
  • HDD Serial Number: It's likely to not change, but can be a nuisance if the HD fails. Check out this MSDN page.
like image 62
mattbasta Avatar answered Sep 29 '22 00:09

mattbasta


If you are on windows HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\ CurrentVersion\ProductId is unique per machine/per windows install. where as in some of the other answers like the MAC address, Proc SN, and HD SN will stay the same between windows reinstalls/dual boot situations.

like image 22
Scott Chamberlain Avatar answered Sep 29 '22 00:09

Scott Chamberlain