Solved

Configure Windows SNMP with VBscript

Posted on 2011-03-25
4
1,953 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
sam0x01 earned 500 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

740 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