Modify Registry Key - Via SMS

I would like to modify and existing registry key to select users in my company. Cannot use GPO or Logon scripts (adm templates). Below is the key. Could someone please give me syntax i would use? I must use SMS to deploy the key. I do not have SMS installer to create the .EXE file

[HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License\LICENSE_SERVER

Current value is @XXXXXX and I need to change it to @YYYYY
mati02Asked:
Who is Participating?
 
CitySecConnect With a Mentor Commented:
1.  Dump the following code in a .vbs file.  I am assuming that the ValueName is LICENSE_SERVER though so you might need to change it.

2.  In the command-line box for the Program enter:  cscript.exe [Name-of-script-file].vbs

Hope that this is more helpful.
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\ESRI\License"
strValueName = "LICENSE_SERVER"
strValue = "@YYYYY"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

Open in new window

0
 
mati02Author Commented:
SMS 2003
0
 
CitySecCommented:
This might help...

How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file:
http://support.microsoft.com/kb/310516

I think you might have to create a batch file and within the batch file run regedit.

Batch File Help:
http://www.computerhope.com/batch.htm
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
CitySecCommented:
Or you could execute a VBScript (which is what I do in my environment) to make the changes by calling "cscript.exe".

The VBScript will be responsible for making the registry change.

Registry Scripting Center
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/registry/#CreateStringDword.htm

Create String and DWORD Values
http://gallery.technet.microsoft.com/ScriptCenter/en-us/8253ebcd-6024-4d0d-944d-0f8c209c933a
0
 
mati02Author Commented:
I need to do this through SMS Silently.
0
 
CitySecCommented:
I know.  Create a Package, then a Program and in the Command Line field just enter the appropriate command-line arguments.  See image.
SCCM-Program-CommandLine.png
0
 
mati02Author Commented:
unfortunately i'm not a scripting master. I will try creating a batch file and run exported key with modifications (which i have) from a file share.
0
 
mati02Author Commented:
batch files will not run through SMS. I ran batch file with

XXX.bat /s and did not work.
0
 
mati02Author Commented:
batch file called the registry key.
0
 
mati02Author Commented:
Excellent. just what i was looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.