?
Solved

Configure Windows SNMP with VBscript

Posted on 2011-03-25
4
Medium Priority
?
2,068 Views
Last Modified: 2012-05-11
Configure Windows SNMP with VBscript

I have an SNMP service to configure in 100 windows 2003 server.
I need a script that reads the name of the servers from a text file-- the names are lined up in a column-- and makes the change to the SNMP config for each server.

the Tabs and fields I need to modify are :

Agent Tab:
Service
Physical=checked
Applications=Checked
Datalink and subnetworks=checked
Internet=checked
End-to-end=checked

Traps Tab
Community name=public
Trap destination= 10.10.10.10

Security Tab:

Community
Public= Read Only
Private = Read Create

Accept SNMP packets from these hosts= selected
                 10.10.10.10




0
Comment
Question by:jskfan
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
sam0x01 earned 2000 total points
ID: 35229149
Save the below as a .reg file
Try importing this reg file into a test server with the same production SNMP settings.

If this corrupts the SNMP Settings, then I am unsure how this can be done.
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters]
"EnableAuthenticationTraps"=dword:00000001
"NameResolutionRetries"=dword:00000010

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers]
"1"="10.10.10.10"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\RFC1156Agent]
"sysContact"=""
"sysLocation"=""
"sysServices"=dword:0000004f

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\public]
"1"="10.10.10.10"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities]
"public"=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Security]
"Security"=hex:01,00,14,80,b8,00,00,00,c4,00,00,00,14,00,00,00,30,00,00,00,02,\
  00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
  00,00,02,00,88,00,06,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
  05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
  20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,\
  00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,00,01,\
  00,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,\
  00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,\
  01,01,00,00,00,00,00,05,12,00,00,00

Open in new window

0
 

Author Comment

by:jskfan
ID: 35340197
Thanks..
I tried it in my workstation and it worked just fine.

How do I deploy it to multiple computers without login into each computer?
0
 
LVL 3

Assisted Solution

by:sam0x01
sam0x01 earned 2000 total points
ID: 35347451
You can run "regedit /s \\servername\share\path\filename.reg" or "reg /import as the command to import. Unfortunately neither regedit or reg /import allow to perform this remotely.

Suggest putting the .reg file on a shared resource and using psexec to perform this remotely. Psexec is a command that allows remote execution of tasks.

Make sure you try it on a single server before pushing it to the masses because it may behave unusually if there is prior SNMP config.

Alternative ways would be using the "AT" command to schedule once. Think schtasks also is in Windows 2003 Server.
0
 

Author Closing Comment

by:jskfan
ID: 35453213
thanks a lot
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn about cloud computing and its benefits for small business owners.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 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