Get-Device -Id 1234 | Set-ObjectProperty InheritLocation $false
You can view all device and group properties modifiable with PrtgAPI by doing
Get-Help ObjectSettings
To identify the name attribute of HTML input tags, in Chrome press Ctrl+Shift+J, click the selector button (top left button in the window that opens) and select the element on the page you wish to inspect. You can also get an idea as to the raw names of things with PrtgAPI
C:\> Get-Device -Id 1234 | Get-ObjectProperty -Raw
name : dc-1
active : 1
ipversion : 0
host : 192.168.0.1
hostv6 :
tags : C_OS_Win
deviceicon : c_os_win.png
serviceurl : http://192.168.0.1
discoverytype : 1
devicetemplate : 0
devicetemplate__check : 0
locationgroup : 1
...
As a general rule, the raw name of a property is whatever is output by Get-ObjectProperty -Raw plus an underscore at the end (unless the property is an inheritance property, which typically end in "group"). So the raw property of the name field is "name_", while location inheritance is just "locationgroup"
Regards,
lordmilko
Add comment