Solved

reg add script to change SNMP sysLocation.

Posted on 2009-05-19
5
642 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Update Services 1 91
Cryptolocker decryption tools? 5 67
How to rename a domain with windows 2003 and exchange 2007 4 52
Windows 2012 KMS Server Trial Key 5 232
Hallo! I guess almost every Windows Administrator must have got stumped with this question "Where does WINDOWS store a users cached credentials? Every user who had once logged onto a Server/Desktop while it was connected to the domain could sti…
This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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…

776 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