Open navigation

Start-TpmsQueryByAgent

Description

Requirement

Syntax

Example 1: cmdlet usage

Example 2: Script containing Start-TpmsQueryByAgent



Description

Starts a query to retrieve printer information from target machines.


Requirement

  • ThinPrint Clients


Syntax

Start-TpmsQueryByAgent -Servers <psobject[]> 
ParameterDescription
-Serverslist of target machines


Example 1: cmdlet usage

The following example retrieves printer information from the computer list represented by the $server vari­able.

Start-TpmsQueryByAgent ($server)


Example 2: Script containing Start-TpmsQueryByAgent

The following script displays the printer lists from ThinPrint Clients which are defined in a .csv file.

  • The definition file thinprint-clients.csv:
"Selected","Address" 
"1","192.168.209.203" 
"1","192.168.149.150" 
"1","192.168.149.14"
  • The PowerShell script:
$allclients = @() 
Import-Csv -Path .\thinprint-clients.csv | foreach { 
if($_.Selected -eq 1) 
{ 
$client = New-TpmsObjTpClient -Name $_.Address -Port 4000 
} 
$allclients += $client 
} 
$srva = New-TpmsObjQueryAgent -Name "cps47.ourdomain.local" -Port 5050 -ClientQueries ($allclients) 
Start-TpmsQueryByAgent -Servers ($srva) | Format-TpmsDispatch

On the target machine cps47, Tpms.Agent connects to the ThinPrint Client addresses defined in thin­print-clients.csv and stores their information to $allclients.

ThinPrint Management Services: printer lists retrieved from two ThinPrint Clients

printer lists retrieved from two ThinPrint Clients


Did you find it helpful? Yes No

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