< Back

New-DeviceParameters

Sun Jan 19, 2020 5:43 pm

NAME New-DeviceParameters



SYNOPSIS

Creates a new set of device parameters for creating a brand new device under a group or probe.





SYNTAX

New-DeviceParameters [-Name] <string> [[-Host] <string>] [<CommonParameters>]





DESCRIPTION

The New-DeviceParameters cmdlet creates a set of parameters for adding a brand new device to PRTG. Device

parameter objects returned from New-DeviceParameters allow specifying a variety of device specific configuration

details including Internet Protocol version and auto-discovery settings at the time of object creation.



All devices must have a Name and Host property specified. If a Host (IP Address/HostName) is not specified in the

call to New-DeviceParameters, PrtgAPI will automatically use the Name



Note that not all device parameters (such as settings that can be inherited from the parent group) can be

specified with PrtgAPI at the time of object creation. If you wish to modify such properties, this can be achieved

after the device has been created via the Set-ObjectProperty cmdlet.





PARAMETERS

-Name <string>

The name to give the new device.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Host <string>

The hostname or IP Address to use for the new device. If no value is specified, the name will be used.



Required? false

Position? 1

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



OUTPUTS



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



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



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



Create a new device named "dc-1" with hostname "dc-1" under the Contoso probe.



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



C:\\> $params = New-DeviceParameters exch-1 "2001:db8::ff00:42:8329"

C:\\> $params.IPVersion = "IPv6"



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



Create a new device named "dc-2" with an IPv6 address, specifying the Internet Protocol as IPv6.



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



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.



---------- EXAMPLE 4 ----------



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



C:\\> Get-Probe contoso | Add-Device $params -PassThru | Set-ObjectProperty Location "23 Fleet Street"



Create a new device named "dc-1" and then set its location.



RELATED LINKS

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

Add-Device

Get-DeviceTemplate

Set-ObjectProperty

Get-Group

Get-Probe