< Back

Get-DeviceTemplate

Sun Jan 19, 2020 5:41 pm

NAME Get-DeviceTemplate



SYNOPSIS

Retrieves all auto-discovery templates supported by a PRTG Server.





SYNTAX

Get-DeviceTemplate [[-Name] <string[]>] [-Device <Device>] [<CommonParameters>]





DESCRIPTION

The Get-DeviceTemplate cmdlet retrieves all device templates supported by a specified object, allowing you to

limit the scope of an auto-discovery operation when creating a new device to a specified set of device types. If

no -Device is specified, by default Get-DeviceTemplate will retrieve device templates supported by the Core Probe

Device (Object ID: 40). Practically speaking, all devices should support all device templates; as such, there

should generally be no need to specify an object.



Results returned by Get-DeviceTemplate can be filtered by specifying one or more expressions to the -Name

parameter. Device template results will be filtered to those that contain a specified expression anywhere in their

Name or Value properties.





PARAMETERS

-Device <Device>

The object to retrieve device templates from. If no object is specified, PrtgAPI will retrieve all templates

supported by the Core Probe Device (ID 40)



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Name <string[]>

Filters results to those whose name contains the specified expression.



Required? false

Position? 0

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

The object to retrieve device templates from. If no object is specified, PrtgAPI will retrieve all templates

supported by the Core Probe Device (ID 40)





OUTPUTS

PrtgAPI.DeviceTemplate





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



C:\\> $templates = Get-DeviceTemplate *wmi*



C:\\> Get-Device -Id 1001 | Start-AutoDiscovery $templates



Perform an auto-discovery for WMI sensors on the device with ID 1001.



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



C:\\> $params = New-DeviceParameters dc-1

C:\\> $params.AutoDiscoveryMode = "AutomaticTemplate"

C:\\> $params.DeviceTemplates = Get-DeviceTemplate *wmi*



C:\\> Get-Probe contoso | Add-Device $params



Create a new device named "dc-1" that performs an auto-discovery for WMI sensors only.



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... iscovery-1

Start-AutoDiscovery

New-SensorParameters

Add-Device