< Back

Get-Channel

Sun Jan 19, 2020 5:40 pm

NAME Get-Channel



SYNOPSIS

Retrieves all channels of a sensor.





SYNTAX

Get-Channel [[-Name] <string>] -Sensor <Sensor> [-Id <int[]>] [<CommonParameters>]



Get-Channel [[-Name] <string>] -SensorId <int> [-Id <int[]>] [<CommonParameters>]





DESCRIPTION

The Get-Channel cmdlet retrieves all channels beloninging to a PRTG Sensor.



Get-Channel uses APIs unsupported by Paessler to retrieve advanced channel settings (limits, thresholds, etc). For

each channel a separate request must be made in order to retrieve advanced channel details, in addition to a

separate single request that retrieves general information for all channels. As such, in order to retrieve

information on n channels, n+1 requests must be made. Keep this in mind when piping sensors with a large number of

channels, or piping a large number of sensors.



If a name is specified, Get-Channel filters the results to those that match the name expression. Due to

limitations of the PRTG API, Get-Channel filters its results post-request. If the specified sensor is read only

for the active PRTG user, certain channel properties will not be displayed.



Get-Channel does not include the Downtime channel present on all sensors (Channel ID -4) as this sensor does not

contain a value in table view. In addition, due to limitations of the PRTG API any channels configured with the

setting "Hide from Tables" will not be returned by Get-Channel





PARAMETERS

-Sensor <Sensor>

The Sensor to retrieve channels for.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SensorId <int>

The ID of the Sensor to retrieve channels for.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Name <string>

Filter the channels retrieved to only those that match a specific name.



Required? false

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Id <int[]>

Filter the channels retrieved to only those that match a specific ID.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PrtgAPI.Sensor

The Sensor to retrieve channels for.



System.Int32

The ID of the Sensor to retrieve channels for.





OUTPUTS

PrtgAPI.Channel





---------- EXAMPLE 1 ----------



C:\\> Get-Sensor -Tags wmicpuloadsensor | Get-Channel



Get all channels from all Windows CPU Load sensors.



---------- EXAMPLE 2 ----------



C:\\> Get-Sensor -Tags wmimemorysensor | Get-Channel Avail*



Get all channels whose names start with "Avail" from all Windows Memory sensors.



---------- EXAMPLE 3 ----------



C:\\> Get-Channel -SensorId 2001



Get all channels from the sensor with ID 2001



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... powershell

Get-Sensor

Set-ChannelProperty