Solved

reg add script to change SNMP sysLocation.

Posted on 2009-05-19
5
637 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:dstewartjr
Comment Utility
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:dstewartjr
Comment Utility
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
Comment Utility
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:
dstewartjr earned 125 total points
Comment Utility
not sure, have always used the regwrite method
0
 

Author Closing Comment

by:LouisvilleMetro
Comment Utility
Thanks again!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now