Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Im looking for a unique GUID stored in the Windows registry that would help me identify a Windows installation or PC.

The GUID must;

  • Always exist
  • Be unique to a particular Windows installation, i.e. no other computer would have the same ID
  • Never change

Many thanks

share|improve this question
    
Why post on SF and SU? superuser.com/questions/82484/… –  MDMarra Dec 12 '09 at 23:51

11 Answers 11

Do you expect this number to change or stay the same if the drive for that install is moved to another system?

Do you expect this number to be changed if the install is cloned with ghost or something else? Can you depend on cloned systems always being sysprep'd following Microsoft's recommendations? The SID should be fine, if you can be sure your installs are never cloned.

In the case of a multi-boot system (i.e. system has Windows 7 and a Windows XP install) do you need to identify the two installs as unique, or related or what?

Why do you need this to be part of the windows installation, and not something presented by the hardware, perhaps the processor serial number?

I am assuming you are asking about this for some kind of script or tool you are using for inventory purposes?

Why don't you simply generate your own number the first time you run the tool and save it in the LOCAL_MACHINE registry hive? Perhaps even use an RFC4122 Type 1 number and which should include the hardware address for one of the network interfaces. That way you can check to see if the UUID still belongs to that system by comparing the UUID against the present network adapters.

share|improve this answer

Assuming it's a Windows server, there's a knowledge base article that talks about how to get it out of Win2k: KB224544.

I don't know if LDP.exe still operates like that, but it may.

share|improve this answer
    
That article only applies to Domain Controllers. –  MDMarra Dec 12 '09 at 23:40
    
Thank you for the information, im looking for a GUID that would exist on all Windows versions, XP and above –  user28967 Dec 12 '09 at 23:48

I'm not so sure a GUID value like the one you describe actually exists. A common practice is to use CPU or motherboard ID info.

Here is a link to a forum post that contains some relevant WMI script code: http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic59274.aspx

share|improve this answer

If you're looking to identify a Windows installation, then you may be out of luck. In corporate environments, workstations are often imaged rather that installed. Each computer built from this image will be identical.

The closest thing to what you've described is the machine's SID, however this doesn't work for two reasons:

  1. Imaged Windows XP machines have the same SID unless you run NewSID against them, which many people don't.
  2. All domain controllers on a single domain share the same machine SID.

What do you need this identifier for? Your best bet may be to generate your own, if that is possible.

share|improve this answer
1  
If the machines are syspreps after imaging then the SID will be different. If they aren't (which all to often they aren't) the SIDs will be the same. –  mrdenny Dec 13 '09 at 21:16

You could try the MAC address, which is at least intended to be globally unique and permanent. This would also have the nice advantage that you could obtain a machine's IP and hostname without too much bother (and it wouln't be restricted to Windows either). It wouldn't meet your requirement of being in the registry, but you can use WMI for it instead.

Sample scripts here: http://www.winforums.com/showthread.php?t=8842

share|improve this answer

How about the DriveId of the system volume? You can get the id from the Win32_Volume WMI class, by looking for entries with SystemVolume True.

In PowerShell:

gwmi win32_volume -filter 'SystemVolume=true' | ft -a DriveLetter,SystemVolume,DeviceId

(This can of course be remoted.)

share|improve this answer

There's a SID used by Windows Update which you might be able to use. Again there is no guarantee that it will be unique every time, or that it won't change.

I think that the closest thing to meet your needs would be the MAC address, however that to could change if the NIC were replaced.

Your best bet would be to write your own GUID into the registry and use that.

share|improve this answer

To confirm the machine SID on a particular machine, you can run SysInternals PSGETSID %COMPUTERNAME%$. (Domain SID).

http://blogs.msdn.com/aaron%5Fmargosis/archive/2009/11/05/machine-sids-and-domain-sids.aspx

EDIT: Removed references to machine SID in registry, which may not be unique (or even correct).

share|improve this answer
    
Oh come on, if you're going to mod someone down, at least leave a comment and let them know what's wrong. –  Matt Simmons Dec 13 '09 at 0:48
    
Machine SIDs are not guaranteed to be unique: blogs.technet.com/markrussinovich/archive/2009/11/03/… –  Dennis Williamson Dec 13 '09 at 1:19
    
@Dennis - right. So if it's on a domain: psgetsid.exe %computername%$ would produce a unique identifier. –  Greg Askew Dec 13 '09 at 3:46
    
@Greg: What if you build your workstations from images? If you didn't run newsid, they'll all share the same machine SID. –  Stephen Jennings Dec 13 '09 at 4:56
    
@Stephen - Using the Domain SID would address that issue. blogs.msdn.com/aaron_margosis/archive/2009/11/05/… –  Greg Askew Dec 13 '09 at 15:34

You want to use the Windows Product ID. This is a unique number generated (hashed) partially from the product key installed, and partially from the hardware configuration, including processor serial number and MAC address from the first NIC. You can read about it on this (somewhat dated, but still valid) TechNet article. The product ID can be found on the System Information screen, or programatically through several methods.

System Information

share|improve this answer

Why not just use the computer name? Its going to be unique within your domain, all windows installations have one and will only change if a domain administrator changes it which should never be needed unless making a correction.

share|improve this answer

I, too need, to find a way to globally uniquely identify Windows installations. Firstly, in order to properly classify and identify backup images and determine which ones get recovered on which machines. Secondly, in order to name sychronization pairs for synchronizing files and to determine which synchronization pair to use depending on the machines involved in the synchronization.

After reading several posts, including those on this website, I conclude that there is no easy way to find a globally unique identifier of a Windows installation. That is too bad. Like the hardware, the software should also have its own serial number. Oh well! So this is my workaround: Instead of finding one single globally unique identifier, I have created a sylized statement, which is inspired on the way in which Microsoft names network drives on Windows and the way it names shared folders in Virtual PC: "[WINDOWS PRODUCT ID (as variable)] Installed on [COMPUTER SERIAL NUMBER (as variable)]." Although a Windows production identification number is unique only insofar as the corresponding product key is, it is, nevertheless, liable to be the same across several installations, especially on mass-produced computers containing factory-installed Windows, but a serial number is unique and is different from one machine to another. The above-mentioned formula is all I need for my purposes; I do not need the SID (I presume that it signifies Security Identifier) or something else more complex, because the combination of both variables references exactly the Windows installation that I need to identify, whereas each individual variable is, on its own, of no use to me. Specifically and firstly, the Windows product identification is identical on computers made by the same manufacturer and found in the same product line and that serves me no purpose, since I own several identical machines. Secondly, the serial number is not uniquely identifying enough, since I do have several Windows installations on one computer that a computer serial number does not address. I therefore suggest my method.

Also, and before you inquire about it: I chose not to base my method on the computer name. The information is user-based and therefore needs to be inventoried. However, the Windows product identification and the computer serial number are already identified, inventoried and invariably connected to two specific products, thereby eliminating the need to inventory them again. I would neither elect to identify a Windows installation with a unique identifier of hard drives, since I am able and quite apt to switch them around from one machine to another, especially when drive capacities are in a state of constant flux. By the same token, I would much less use the identifying nomenclature of either the central processing unit or the motherboard, as has been heretofore suggested in a previous reply by Shoeless. Finally, I also reject the most obvious option of identifying a Windows installation (although it has not been mentionned by anybody else from what I can see): using the product key. Although it is unique, it is only a license to install a certain version of Windows; it is not actually connected to a particular Windows installation and it does not distinguish it as being installed on a particular machine, even though the license was granted by virtue of the purchase a given computer.

share|improve this answer
1  
And your answer to the question is...? –  Deer Hunter Oct 1 at 5:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.