Scripting SNMP settings

Associate
Joined
6 Oct 2006
Posts
375
Location
Luton
Hi

I need to set an SNMP community string on a whole load of servers. I have the script that is shown below. I think this was written to work with 2003, does anybody know if this will also work with windows 2008 and 2008 R2.

Or is there a better way to do this.

Dim strKey, FSO
logfile = "C:\serversdone.txt"
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")

arrComputers = Split(FSO.OpenTextFile("C:\Computers.txt").ReadAll,vbNewLine)
For Each strComputer in arrComputers

Set filetemp = FSO.OpenTextFile(logfile, 8, True)
'wscript.echo strComputer
objshell.Run "reg add \\" & strComputer & "\HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\test1\", True
objshell.Run "reg add \\" & strComputer & "\HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities\ /v test1 /t REG_DWORD /d 4", True

filetemp.Write strComputer
filetemp.Write " Done At "
filetemp.Write Now
filetemp.Write VbCrLf
filetemp.Close

Next

Thanks
 
I have just had a chance to test this script on Windows 2008 and Windows 2008 R2 and if SNMP is installed it will work fine.

Now, I need to get a way of installing SNMP on the servers which do not have it.
 
Back
Top Bottom