44 views 0


Defines a model for a normal Standard TCP/IP Port. The model is represented by a container that predefines all printer ports to be installed by Tpms.Agent in one variable.

Afterwards, this model can be used to define the target machine using New-TpmsObjApplyAgent and to perform the installation process using Start-TpmsApplyByAgent.

path of print data with Microsoft’s Standard TCP/IP printing


New-TpmsObjTcpIpPortRaw -Name <String> -HostAddress <string> -PortNumber <uint32>


Parameter Description
-Name sets the printer port name; the port name should end with a colon ( : ), examples:

StandardTcpIpPort: or “Standard TcpIp Port:”

-PortNumber sets the TCP port for sending print jobs; see Port Number
-HostAddress sets the printer’s target address; see Printer Name or IP Address

Standard TCP/IP Port settings

Example 1: cmdlet usage

The following example defines a Standard TCP/IP Port with the denomination TpmsTestPort:, the IP address and the TCP port 9100 (on the machine on which Tpms.Agent runs).

See also New-TpmsObjApplyAgent for advice on using a variable.

See also Add-TpmsSnmpInfo for adding SNMP settings.

New-TpmsObjTcpIpPortRaw -PortNumber 9100 -HostAddress -Name TpmsTestPort:

Example 2: Script containing New-TpmsObjTcpIpPortRaw

The following script creates ten printers with Standard TCP/IP Ports which are defined in a .csv file.

  • The definition file network-printers.csv:

"1","PRN01-BLN","PRN01-BLN:","","Lexmark T644 (MS)","Lexmark T644"

"1","PRN02-PRS","PRN02-PRS:","","Kyocera FS-C8500DN","Kyocera FS-C8500DN"

"1","PRN03-WRS","PRN03-WRS:","","Canon LBP7660C Class Driver","Canon LBP7660C"

"1","PRN04-PRG","PRN04-PRG:","","Brother PCL6 Class Driver","Brother"

"1","PRN05-MSC","PRN05-MSC:","","Xerox Phaser 6300N","Xerox Phaser 6300N"

"1","PRN06-LDN","PRN06-LDN:","","Dell B1265dnf Laser MFP PCL6","Dell B1265dnf Laser MFP"

"1","PRN07-OSL","PRN07-OSL:","","HP Color LaserJet 9500 PCL6 Class Driver","HP Color LaserJet 9500"

"1","PRN08-STK","PRN08-STK:","","KONICA MINOLTA PS Color Laser Class Driver","KONICA MINOLTA PS Color Laser"

"1","PRN09-KPN","PRN09-KPN:","","OKI PCL6 Class Driver","OKI"

"1","PRN10-BPT","PRN10-BPT:","","Samsung ML-4555 Series PCL6","Samsung ML-4555"
  • The PowerShell script:
$allports = @()

$allprinters = @()

Import-Csv -Path .\network-printers.csv | foreach {

if($_.Selected -eq 1)


$port = New-TpmsObjTcpIpPortRaw -Name $_.PortName -PortNumber 9100 -HostAddress $_.Address

$printer = New-TpmsObjPrinter -Name $_.PrinterName -Driver $_.DriverName -Port $_.PortName -Template $_.TemplateName


$allports += $port

$allprinters += $printer


$srva = New-TpmsObjApplyAgent -Name "cps47.ourdomain.local" -Port 5050 -Printers ($allprinters) -Ports ($allports)

Start-TpmsApplyByAgent -Action Deploy -Servers ($srva) | Format-TpmsDispatch

On the target machine cps47.ourdomain.local, the script creates and configures ten Standard TCP/IP Ports with ten printers connected to them. All port and printer settings can be found in the relevant .csv file.

Start-TpmsApplyByAgent -Action Deploy creates ports and printers on the target machine and -Action Remove deletes them.

printers and ports created by Tpms.Agent on the given target machine cps47

Previous Page
Next Page

Was this helpful?