LouisvilleMetro
asked on
reg add script to change SNMP sysLocation.
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.
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"
More complete below:
DIM Path,Location,WshShell
Set WshShell = CreateObject("WScript.Shel l")
Path="HKLM\SYSTEM\CurrentC ontrolSet\ Services\S NMP\Parame ters\RFC11 56Agent\"
Location="XX-location-XX"
WshShell.RegWrite Path & "sysLocation",Location,"RE G_SZ"
DIM Path,Location,WshShell
Set WshShell = CreateObject("WScript.Shel
Path="HKLM\SYSTEM\CurrentC
Location="XX-location-XX"
WshShell.RegWrite Path & "sysLocation",Location,"RE
ASKER
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.
thanks again for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again!
DIM Path,Location
Path="HKLM\SYSTEM\CurrentC
Location="XX-location-XX"
WshShell.RegWrite Path & "sysLocation",Location,"RE