View Single Post
Old 10-11-2006   #1 (permalink)
Jens Schulze


 
 

Creating new Printer-Port and installing new Printer

Hello
i found following WSH-Skript at die MSDN-Website. But how can i do this with
the powershell? I do not know how to create a new instance of the
Win32_TCPIPPrinterPort-Class.

thanks Jens

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_

objNewPort.Name = "IP_169.254.110.14"
objNewPort.Protocol = 1
objNewPort.HostAddress = "169.254.110.14"
objNewPort.PortNumber = "9999"
objNewPort.SNMPEnabled = False
objNewPort.Put_



My System SpecsSystem Spec