bsharath
asked on
Bulk change the Operating system serial no (Os Product key).Vbs/Excel macro.
Hi,
Bulk change the Operating system serial no (Os Product key).Vbs/Excel macro.
can anyone help with a code that can change all the machines in a txt file or excel colum A with a different Product key.
REgards
Sharath
Bulk change the Operating system serial no (Os Product key).Vbs/Excel macro.
can anyone help with a code that can change all the machines in a txt file or excel colum A with a different Product key.
REgards
Sharath
Hi, check out the scripts on this page, under "Method 2":
How to change the Volume Licensing product key on a computer that is running Windows XP Service Pack 1 and later versions of Windows XP
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q328874
I have never used them, but I know that version of the Magic Jelly Bean tool 1.51 and older used this code to change the license key. Use the ChangeVLKeySP1.vbs if you're running Windows XP SP1 or later.
Regards,
Rob.
How to change the Volume Licensing product key on a computer that is running Windows XP Service Pack 1 and later versions of Windows XP
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q328874
I have never used them, but I know that version of the Magic Jelly Bean tool 1.51 and older used this code to change the license key. Use the ChangeVLKeySP1.vbs if you're running Windows XP SP1 or later.
Regards,
Rob.
ASKER
Rob any ways to change on a lot of systems in one show.
I have the names and serial no's in the excel. If the script can check colum Q for machine names and if OS win xp change the serial no to whats there in colum "BW"
I have the names and serial no's in the excel. If the script can check colum Q for machine names and if OS win xp change the serial no to whats there in colum "BW"
OK, I would advise you to test this in a new workbook, with just one PC in column Q (starting at row 2), and one License Key in column BW.
Regards,
Rob.
Regards,
Rob.
Sub Change_WindowsXP_SP1_Key()
Const HKLM = &H80000002
Dim VOL_PROD_KEY
For intRow = 2 To Cells(65536, "Q").End(xlUp).Row
strComputer = Trim(Cells(intRow, "Q").Value)
If strComputer <> "" Then
If Ping(strComputer) = True Then
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select Caption,ServicePackMajorVersion from Win32_OperatingSystem", , 48)
For Each objItem In colItems
strCaption = objItem.Caption
strSPMajor = objItem.ServicePackMajorVersion
Next
VOL_PROD_KEY = Trim(Cells(intRow, "BW").Value)
VOL_PROD_KEY = Replace(VOL_PROD_KEY, "-", "") 'remove hyphens if any
If InStr(strCaption, "XP Professional") > 0 And CInt(strSPMajor) >= 1 Then
On Error Resume Next
For Each objProduct In GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer).InstancesOf("win32_WindowsProductActivation")
result = objProduct.SetProductKey(VOL_PROD_KEY)
If Err <> 0 Then
MsgBox Err.Description & vbCrLf & "0x" & Hex(Err.Number)
Err.Clear
End If
Next
On Error GoTo 0
ElseIf InStr(strCaption, "XP Professional") > 0 Then
Set objReg = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" & strComputer & "/root/default:stdRegProv")
On Error Resume Next
objReg.DeleteValue HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents", "OOBETimer" 'delete OOBETimer registry value
Err.Clear
For Each Obj In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("win32_WindowsProductActivation")
result = Obj.SetProductKey(VOL_PROD_KEY)
If Err <> 0 Then
MsgBox Err.Description & vbCrLf & "0x" & Hex(Err.Number)
Err.Clear
End If
Next
On Error GoTo 0
End If
End If
End If
Next
End Sub
Function Ping(strComputer)
Dim objShell, boolCode
Set objShell = CreateObject("WScript.Shell")
boolCode = objShell.Run("Ping -n 1 -w 300 " & strComputer, 0, True)
If boolCode = 0 Then
Ping = True
Else
Ping = False
End If
End Function
ASKER
Ron i get this
-------------------------- -
Microsoft Excel
-------------------------- -
Generic failure
0x80041001
-------------------------- -
OK
-------------------------- -
I will have systems mainly with Win Xp sp2 and Sp3 will that be an issue
--------------------------
Microsoft Excel
--------------------------
Generic failure
0x80041001
--------------------------
OK
--------------------------
I will have systems mainly with Win Xp sp2 and Sp3 will that be an issue
ASKER
Ron i get this
-------------------------- -
Microsoft Excel
-------------------------- -
Generic failure
0x80041001
-------------------------- -
OK
-------------------------- -
I will have systems mainly with Win Xp sp2 and Sp3 will that be an issue
--------------------------
Microsoft Excel
--------------------------
Generic failure
0x80041001
--------------------------
OK
--------------------------
I will have systems mainly with Win Xp sp2 and Sp3 will that be an issue
Are you running the Excel spreadsheet as a user who has full admin rights over the remote machine? You will need these rights to change such keys....
Rob.
Rob.
ASKER
Yes i am running from a Domain Admin permission
Which line is the error on?
ASKER
It does not take me to the code... I get this popup and continues
ASKER
It does not take me to the code... I get this popup and continues
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get this
-------------------------- -
Microsoft Excel
-------------------------- -
Product ID for Dev515: 76487-640-1068332-23346
Windows XP Professional SP1 or greater.
-------------------------- -
OK
-------------------------- -
--------------------------
Microsoft Excel
--------------------------
Product ID for Dev515: 76487-640-1068332-23346
Windows XP Professional SP1 or greater.
--------------------------
OK
--------------------------
ASKER
I get this
-------------------------- -
Microsoft Excel
-------------------------- -
Product ID for Dev515: 76487-640-1068332-23346
Windows XP Professional SP1 or greater.
-------------------------- -
OK
-------------------------- -
--------------------------
Microsoft Excel
--------------------------
Product ID for Dev515: 76487-640-1068332-23346
Windows XP Professional SP1 or greater.
--------------------------
OK
--------------------------
Hmmm, so if you uncomment lines 24 through 28 above:
'result = objProduct.SetProductKey(V OL_PROD_KE Y)
'If Err <> 0 Then
' MsgBox Err.Description & vbCrLf & "0x" & Hex(Err.Number)
' Err.Clear
'End If
and run it again, does it work? Are you sure you have a valid license key in column BW?
Regards,
Rob.
'result = objProduct.SetProductKey(V
'If Err <> 0 Then
' MsgBox Err.Description & vbCrLf & "0x" & Hex(Err.Number)
' Err.Clear
'End If
and run it again, does it work? Are you sure you have a valid license key in column BW?
Regards,
Rob.
ASKER
I did the change but still does not update the serial no
Serial no is correct and machine live.
Running it from a machine where i have powers on the remote machine
Serial no is correct and machine live.
Running it from a machine where i have powers on the remote machine
I have just read that this method cannot be used with OEM versions of Windows XP, because this method is only valid if the ActivationRequired property is equal to 1, and OEM keys do not require activation.
This gives you some more info, but if you're trying to use keys that don't require activation, you're out of luck on this one.
http://technet.microsoft.com/en-us/library/bb457096.aspx
Regards,
Rob.
This gives you some more info, but if you're trying to use keys that don't require activation, you're out of luck on this one.
http://technet.microsoft.com/en-us/library/bb457096.aspx
Regards,
Rob.
ASKER
:-(
Would there be no workaround Rob... If not through Excel...Some tool that can be used for bulk change?
With some code
Would there be no workaround Rob... If not through Excel...Some tool that can be used for bulk change?
With some code
ASKER
:-(
Would there be no workaround Rob... If not through Excel...Some tool that can be used for bulk change?
With some code
Would there be no workaround Rob... If not through Excel...Some tool that can be used for bulk change?
With some code
I'd be surprised if there was.....you might try the Magic Jelly Bean Keyfinder tool. Make sure you get version 1.51 from 08.6.2006
Then run it manually on a machine and see if it lets you change the key to one you want.
If that doesn't work, you won't be able to without violating the Activation of the workstation, I don't think.
Regards,
Rob.
Then run it manually on a machine and see if it lets you change the key to one you want.
If that doesn't work, you won't be able to without violating the Activation of the workstation, I don't think.
Regards,
Rob.
Ooops, forgot the link
http://www.magicaljellybean.com/keyfinder/old.shtml
http://www.magicaljellybean.com/keyfinder/old.shtml
ASKER
Rob checking on this...
Any help on this
https://www.experts-exchange.com/questions/24401399/Excel-Macro-that-finds-the-configuration-of-machines-whose-names-are-in-the-colum-Q-Need-a-change.html
Any help on this
https://www.experts-exchange.com/questions/24401399/Excel-Macro-that-finds-the-configuration-of-machines-whose-names-are-in-the-colum-Q-Need-a-change.html
ASKER
Rob i did run this
Magic Jelly Bean Keyfinder tool. version 1.51 from 08.6.2006
But there is no option to change.
I am able to view only
Magic Jelly Bean Keyfinder tool. version 1.51 from 08.6.2006
But there is no option to change.
I am able to view only
ASKER
Rob i did run this
Magic Jelly Bean Keyfinder tool. version 1.51 from 08.6.2006
But there is no option to change.
I am able to view only
Magic Jelly Bean Keyfinder tool. version 1.51 from 08.6.2006
But there is no option to change.
I am able to view only
When I use that, I have this option.
If you don't have this option, then I don't think it is possible to change your keys.
Regards,
Rob.
KeyFinder151.jpg
If you don't have this option, then I don't think it is possible to change your keys.
Regards,
Rob.
KeyFinder151.jpg
ASKER
Rob change windows key is disabled for me in all machines that i tried...
ASKER
Rob change windows key is disabled for me in all machines that i tried...
Hmmm, in that case you must have Windows Keys that cannot be changed, most likely because they would have been pre-activated by your manufacturer. I am not aware of any other way to change the Windows key.
Rob.
Rob.
ASKER
ASKER
ASKER
Hi Rob can you see this link...
Will this help with this Q...
http://desktopsuport.blogspot.com/2009/07/how-to-change-volume-licensing-product.html
Will this help with this Q...
http://desktopsuport.blogspot.com/2009/07/how-to-change-volume-licensing-product.html
Let's see if some other Experts have more input...
JeffCoachman