Open navigation

Creating a printer on a Standard TCP/IP Port

# Step 1

# Step 2

# Step 3



# Step 1

# Specify the Standard TCP/IP Port with the network printer’s IP address (-HostAddress) and TCP port (-PortNumber). The port name should end with a colon ( : ) – here, Lexmark01:

$port = New-TpmsObjTcpIpPortRaw -Name Lexmark01: -PortNumber 9100 -HostAddress "192.168.209.204"

# Specify a printer name (here, PRN01-BLN) and a driver (here, Lexmark T644 (MS)) as well as the name of the port the printer is to be connected to. Here, the respective printer driver must already be installed on the target machine; this can be done manually or using New-TpmsObjDriver. Additionally, choose an existing printer as template to transfer its printer properties and settings to the printer to be created (-Template).

$printer = New-TpmsObjPrinter -Name "PRN01-BLN" -Driver "Lexmark T644 (MS)" -Port Lexmark01: -Template "Lexmark T644 (MS)"

# Note: If the template is on a remote machine, its name must be specified with FQDN address.
Example: -Template "\\cps48.ourdomain.local\Lexmark T644 (MS)"

The service of the Tpms.Agent that creates the printers must run with an account that has the permis­sion to access the share of the template located on the remote computer.

# Set the printer to be shared. On this, specify a share name using Add-TpmsSharingInfo (here, PRN01-BLN) and add this information to the same variable (-Printers):

Add-TpmsSharingInfo -Printers ($printer) -Name "PRN01-BLN" -Mode Network


# Step 2

# Specify the Tpms.Agent address (here, tpms002.ourdomain.local) with TCP port using New-TpmsOb­jApplyAgent and collect the relevant printer and port settings with the parameters -Printers and -Ports in a data package (here, $srv):

$srv = New-TpmsObjApplyAgent -Name "tpms002.ourdomain.local" -Port 5050 -Printers ($printer) -Ports ($port)


# Step 3

# Send the specified data package to Tpms.Service which forwards it to the relevant Tpms.Agent. The agent will create port and printer and connect the printer to the port:

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

Deploy enables this action – i. e., printer and port will be created. Remove disables it – i. e., printer and port will be deleted. Format-TpmsDispatch displays the output in table form.

ThinPrint Management Services: new Standard TCP/IP Port Lexmark01: created

ThinPrint Management Services: Windows Print Management: new printer PRN01-BLN and its template Lexmark T644 (MS)

For an example script with multiple printers see Script containing New-TpmsObjTcpIpPortRaw.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.