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.
Thanks
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