Tested on PRTG 19.4.54.1506
$Global:APIkeys = [PSCustomObject]@{
GetAllDevices = 'api/table.xml?content=devices&output=csvtable&columns=objid,device,host&count=2500&id={0}'
GetDeviceSensor = 'api/table.xml?content=sensors&output=csvtable&columns=objid,device,sensor,status&id={0}'
DuplicateSensor = 'api/duplicateobject.htm?id={0}&name={2}&targetid={1}' #SourceID, NewName, TargetID
Resume = 'api/pause.htm?id={0}&action=1'
Pause = 'api/pause.htm?id={0}&action=0'
}
PS C:\>.\copy-PRTGSensor.ps1 -PRTGHost 'https://prtg.westeurope.cloudapp.azure.com/' -UserName apiadmin -Passhash 0123456789 -SourceSensorID 1200,1201 -TargetDeviceID 8001,8002 -Verbose
SourceSensor | Success | TargetDevice |
---|---|---|
Microsoft Hyper-V Network Adapter | True | Server1 |
Microsoft Hyper-V Network Adapter | True | Server2 |
SNMP Traffic | False | Server1 |
SNMP Traffic | True | Server2 |