I have a simple script I am using to disable SNMP on TCP/IP printer ports. Problem is that I have about 400 ports to config so scripting one port at a time is hardly faster than changing the property in the printer port dialog box. Here's the script:
Set objWMIService = GetObject("winmgmts:")
Set objPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objPort.Name = "IP_192.168.1.25"
objPort.Protocol = 1
objPort.HostAddress = "192.168.1.25"
objPort.PortNumber = "9999"
objPort.SNMPEnabled = False
objPort.Put_
What I need to do is either:
A) Turn off SNMP for all TCP/IP ports on the box (instead of specifying each IP port)
or....
B) Pull the port info from a text file in which I can copy/paste a list of IP ports to apply the script to. Problem here is that it requires objPort.Name and objPort.HostAddress (which is preceeded by IP_).
I'm a total scripting hack but trying to learn. Any help appreciated!