Open navigation

How to create a first printer with Tpms?

Three-step architecture

Step 1

Step 2

Step 3

Initiating Tpms.Powershell

Step 1

Steps 1 and 2

Step 3

Creating the printer

Step 1

Step 2

Step 3

Removing the printer

Step 3



Three-step architecture

Step 1

– specifies settings using the Add-Tpms, New-Tpms or Set-Tpms cmdlets

or

– retrieves data from different sources (e. g. from files, databases or ThinPrint Clients)


Step 2

– collects all settings and writes them to a data package (using variables)


Step 3

– sends the data package via Tpms.Service to the relevant agents. Then, the agents execute the com­mands from the package on the local machine.

Below you’ll find an example for using the cmdlets of Tpms.Powershell to create a first printer. This printer will be connected to a Standard TCP/IP Port and a native driver will be assigned. The numbering corresponds to the three steps above. Here, the variable of the data package which contains the settings array is $srv.

The values which must be replaced by your own settings are marked orange.


Initiating Tpms.Powershell

On the admin computer, run PowerShell as administrator from Windows’ Start menu.


Step 1

– Specify the address of Tpms.Service:

Set-TpmsServiceUrl -Uri "https://licenseserver.ourdomain.local:4040"

– To display messages, set the logging level to Info:

Set-TpmsLogLevel -RelayLogLevel Info

Steps 1 and 2

– Specify the target machine where Tpms.Agent is installed.

If Tpms.Agent is running locally, enter:

$srv = New-TpmsObjSetupAgent -Name "cps47.ourdomain.local" -Port 5050

If Tpms.Agent is running remotely, enter:

$srv = New-TpmsObjSetupAgent -Name "cps47.ourdomain.local" -Port 5050 -Credential (Get-Credential -Message "Please enter your credentials." -UserName "ourdomain\Administrator")

A window will open. Enter admin credentials of the target machine to be able to retrieve the certificates.

Creating a printer with ThinPrint Management Services: entering credentials


Step 3

– Send the specified settings to Tpms.Service. This initiates Tpms.Powershell.

The cmdlet Set-TpmsServiceUrl must be run one-time on each admin computer (not with each script).

However, the cmdlet New-TpmsObjSetupAgent must be run one-time for each Tpms.Agent (also not with each script).

Start-TpmsSetupByAgent -Servers ($srv)

Creating a printer with ThinPrint Management Services: sending settings to Tpms.Service


Creating the printer

Step 1

– Specify the Standard TCP/IP Port with IP address (-HostAddress) and TCP port (-PortNumber). The port name should end with a colon ( : ). Here, Lexmark:

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

– Specify printer name (here, Lexmark T644) and driver (here, Lexmark T644 (MS)) as well as the name of the port the printer is to be connected to:

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

Step 2

– Specify the target machine’s1 address with New-TpmsObjApplyAgent and collect the relevant printer and port settings with the parameters -Printers and -Ports:

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

Creating a printer with ThinPrint Management Services: specifying the printer


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.

Deploy enables this action – i. e., printer and port will be created. Remove disables it – i. e., printer, port and/or driver will be removed (see below). Format-TpmsDispatch displays the output in table form:

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

Creating a printer with ThinPrint Management Services: running the script

Creating a printer with ThinPrint Management Services: printer created


Removing the printer

Step 3

– Remove the printer created above with:

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

For more examples see the sections Practice and Cmdlets.


1 on which Tpms.Agent is installed, here: tpms002.ourdomain.local


Did you find it helpful? Yes No

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