Solved

reg add script to change SNMP sysLocation.

Posted on 2009-05-19
5
646 Views
Last Modified: 2013-11-05
I have a script to add snmp settings a group of servers that need to be monitored by HP SIM. The script work fine except I have been asked to add a different "Value Data" to the "sysLocation". The sysLocation string value is a default windows value wiht no entry for "value data". I need to change that using my reg add script.

I have tried to add the value, delete the value and recreate. It seems the  string is locked, the permissions are correct. I am just having issues with this one string.

Has anyone scripted the attribute change to this string? If so how? thanks ahead of time for the help.
objshell.Run "reg add \\" & strComputer & "\HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent\ /ve sysLocation /t REG_SZ /d XX-location-XX"

Open in new window

0
Comment
Question by:LouisvilleMetro
  • 3
  • 2
5 Comments
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 24423121
Try below:
 
DIM Path,Location
Path="HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent\"
Location="XX-location-XX"
WshShell.RegWrite  Path & "sysLocation",Location,"REG_SZ"
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 24423176
More complete below:
 

DIM Path,Location,WshShell
Set WshShell = CreateObject("WScript.Shell")
Path="HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent\"
Location="XX-location-XX"
WshShell.RegWrite  Path & "sysLocation",Location,"REG_SZ"
0
 

Author Comment

by:LouisvilleMetro
ID: 24423272
It changes the attribute! I am curious as to why the reg add will not change the value. Do you have any insight into this?

thanks again for your help.
0
 
LVL 47

Accepted Solution

by:
Donald Stewart earned 125 total points
ID: 24423420
not sure, have always used the regwrite method
0
 

Author Closing Comment

by:LouisvilleMetro
ID: 31583042
Thanks again!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question