Description
Defines a model for a ThinPrint Port with the Virtual Channel Protocol type1. 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.
Note! Please also refer to the section Connecting printers to ThinPrint Ports.
Requirements
- ThinPrint Engine
- ThinPrint Clients (RDP or ICA type)
path of print data with Virtual Channel printing
Parameter | Description |
-Name | printer port name to be created; the port name must end with a colon ( : ), examples: VcpPort: or "Vcp Port:" |
-TcpPort | TCP port to open a connection to a Virtual Channel Gateway (default: 4000); |
-BandwidthCtrl | bandwidth for printing limited to 1–10,000 kbit/s (kbps); see Bandwidth control; default: unlimited Up to installer version 1.0.53 or 1.0.61, the value had to be given in bps instead of kbps. |
-IsEncrypted | enables SSL encryption (default: 0) 1: enabled 0: disabled |
-Compression | compression level {Disabled | Level0 | Level1 | BestSpeed | Level2 | Level3 | Level4 | Level5 | Level6 | Default | Level7 | Level8 | Level9 | BestCompression} |
-PackageSize | size of IP datagrams (in Byte) to be sent to the ThinPrint Client (default: 65535) |
-Scheme | Old : printer naming convention UserName:PrinterId#PrinterName New : printer naming convention PrinterName#UserName:PrinterId (default) see Naming convention |
-Version | optional: ThinPrint Port Monitor version (default: 151257685) |
ThinPrint Port settings: Virtual Channel Protocol port type (Vcp)
ThinPrint Port settings: Naming convention
Example 1: cmdlet usage
New-TpmsObjTpPortVcp -BandwidthCtrl 256 -IsEncrypted 0 -Compression Default -Name Vcp:
Defines a ThinPrint Port with the denomination Vcp:, the print protocol Citrix ICA or Microsoft RDP, bandwidth limited to 256 kbit/s (kbps), no encryption and the default compression level.
Example 2: script containing New-TpmsObjTpPortVcp (for both Native Printing and Driver Free Printing)
The following script creates and shares a number of printer templates for ThinPrint Engines installed on three terminal servers (here: ts01 ... ts03) with native drivers (called Native Printing) and with TP Output Gateway as driver (called Driver Free Printing) – each connected to a port pool defined in the .csv file vc-port-pool.csv. The printer information is retrieved from the .csv files native-printers.csv as well as tpog-printers.csv. The printer properties are retrieved from the Tpms templates defined in the respective printer definition file – native-printers.csv or tpog-printers.csv.
For each printer read from the definition files a relevant ThinPrint printer with its driver as well as the ThinPrint Port pool is created.
Note! The general Windows rule for port pooling or so-called printer pooling is:
length of port name ´ number of ports £ 200
With the exampleThinPrint000: to ThinPrint004:we have 13 ´ 5 = 65 characters.
- The port pool definition file vc-port-pool.csv:
"Selected","PortName" "1","ThinPrint000:" "1","ThinPrint001:" "1","ThinPrint002:" "1","ThinPrint003:" "1","ThinPrint004:"
- The definition file for Output Gateway printer templates tpog-printers.csv:
"Selected","PrinterName","TemplateName" "1","_#Output Gateway color","TP Output Gateway color" "1","_#Output Gateway b+w","TP Output Gateway b+w"
- The definition file for printer templates with native drivers native-printers.csv:
"Selected","PrinterName","DriverName","TemplateName" "1","_#HP DeskJet 500C","HP DeskJet 500C","HP DeskJet 500C" "1","_#HP DeskJet 500","HP DeskJet 500","HP DeskJet 500"
- The PowerShell script:
$ports = @() $allports = @() $printers = @() $nprinters = @() $allprinters = @() Import-Csv -Path .\vc-port-pool.csv | foreach { if($_.Selected -eq 1) { $ports += New-TpmsObjTpPortVcp -Name $_.PortName $allports += $_.PortName } } Import-Csv -Path .\tpog-printers.csv | foreach { if($_.Selected -eq 1) { $printer = $_.PrinterName $template = $_.TemplateName $printers = New-TpmsObjPrinterTpog -Name ($printer) -Port ([string]::Join(",", $allports)) -Template ($template) $allprinters += $printers } } Import-Csv -Path .\native-printers.csv | foreach { if($_.Selected -eq 1) { $nprinter = $_.PrinterName $ndriver = $_.DriverName $ntemplate = $_.TemplateName $nprinters = New-TpmsObjPrinter -Name ($nprinter) -Port ([string]::Join(',', $allports)) -Driver ($ndriver) -Template ($ntemplate) $allprinters += $nprinters } } $srva = New-TpmsObjApplyAgent -Name "ts01.ourdomain.local" -Port 5050 -Printers ($allprinters) -Ports ($ports) $srvb = New-TpmsObjApplyAgent -Name "ts02.ourdomain.local" -Port 5050 -Printers ($allprinters) -Ports ($ports) $srvc = New-TpmsObjApplyAgent -Name "ts03.ourdomain.local" -Port 5050 -Printers ($allprinters) -Ports ($ports) Start-TpmsApplyByAgent -Action Deploy -Servers ($srva,$srvb,$srvc) | Format-TpmsDispatch
Start-TpmsApplyByAgent -Action Deploy creates ports and printers on the target machine and -Action Remove deletes them.
Printers folder on the central print server: template printers before running the script
Printers folder on the central print server: template printers as well as four ThinPrint templates (with TP Output Gateway and HP DeskJet 500/500C as driver) created and shared by the script above
ThinPrint Port Manager: template printers connected to ThinPort: as well as four ThinPrint Engine templates – each connected to a port pool composed of five ThinPrint VCP Ports created by the script above
1 Print print data are sent – bandwidth controlled and compressed – from a user session (Microsoft RDP or Citrix ICA) directly to ThinPrint Clients on workstations or thin clients.