Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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

9 Answers 9

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

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

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.