Home » Questions » Computers [ Ask a new question ]

How to obtain the Windows product id from registry from a remote machine

How to obtain the Windows product id from registry from a remote machine

Would like some assistance on how to obtain the Windows product id from the registry that will work where the WIndows (Windows 2003 Server, 2008 Server) is on a Domain or Workgroup and a remote machine.

Asked by: Guest | Views: 145
Total answers/comments: 2
bert [Entry]

"I did a bit of thinking outside of the box and I have come up with slightly different solution, just need to test it out. I think I can get the product id from the machine via the SQL instance...

DECLARE @retvalue int, @data varchar(500)
EXECUTE @retvalue = master.dbo.xp_instance_regread 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\Windows NT\CurrentVersion',
'ProductId', @param = @data OUTPUT
PRINT 'ProductId: '+ @data

I will update this if this solution works , however if anyone has another solution please let me know."
bert [Entry]

The product key is not kept in the registry. The product ID (which is partly based on the product key) is available in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion