Open navigation

Creating a V-Layer in which both printer objects are shared

# Step 1.1

# Step 2.1

# Step 3.1

# Step 1.2

# Step 2.2

# Step 3.2



# Step 1.1

# A V-Layer consists of both a pair of printers and a pair of printer ports. One printer uses a native driver (= native printer), the other uses TP Output Gateway as driver (= Output Gateway printer). After creating the printers, Tpms.Agent transfers the printer settings from a native printer template to the native printer and from there to the Output Gateway printer.

# In the following example, the two printer ports – TP_hp2: for the native printer and MSVPort: for the output gateway printer – already exist.

# Define a native printer with a template to read in the printer properties (these are transferred from the template to the native printer object and – additionally – to the Output Gateway printer object):

$nativeprinter = New-TpmsObjPrinter -Name "HP-TPMPS5_n_" -Driver "HP Universal Printing PCL 6" -Port TP_hp2: -Template "TPMSHPTemplate"

# Note: If the template is on a remote machine, its name must be specified with FQDN address. Example: 

-Template "\\spt-2019-ps1.berlin.support.tp\TPMSHPTemplate"

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

# Define the Output Gateway printer (this is usually to be mapped into a user session):

$tpogprinter = New-TpmsObjPrinterTpog -Name "HP-TPMPS5" -Port MSVPort:

# Set the V-Layer pair (this will connect the Output Gateway printer to the native printer):

$vlayer = New-TpmsObjVLayerPair -Name "HP-TPMPS5" -Printer "HP-TPMPS5_n_"

# Step 2.1

# Specify the Tpms.Agent address (here, spt-2019-ps1.berlin.support.tp) with TCP port (5050) using New-TpmsObjApplyAgent and collect the relevant printer and port settings with the parameters -Print­ers and -Ports in a data package (here, $srv):

$srv = New-TpmsObjApplyAgent -Name "spt-2019-ps1.berlin.support.tp" -Port 5050 -VLayerConnections ($vlayer) -Ports ("TP_hp2:", "MSVPort:") -Drivers ("HP Universal Printing PCL 6") -Printers ($nativeprinter, $tpogprinter)

# Step 3.1

# Send the specified data package to Tpms.Service which forwards it to the relevant Tpms.Agent. The agent will create ports and printers and connect the Output Gateway printer to the native printer:

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

# Step 1.2

# Only now should you specify that the native printer object is to be shared:

Add-TpmsSharingInfo -Printers ($nativeprinter) -Name "HP-TPMPS5_n_" -Mode Network

# Set the Output Gateway printer object also to be shared: 

Add-TpmsSharingInfo -Printers ($tpogprinter) -Name "HP-TPMPS5" -Mode Network

# Step 2.2

# Specify the address of the Tpms.agent again and collect the relevant printer and port settings with the parameters -Printers and -Ports in a data package (here: $srv):

$srv = New-TpmsObjApplyAgent -Name "spt-2019-ps1.berlin.support.tp" -Port 5050 -Printers ($nativeprinter, $tpogprinter)

# Step 3.2

# Resend the specified data packet to the Tpms.Service, which forwards it to the relevant Tpms.Agent:

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. 

Did you find it helpful? Yes No

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