Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Server = "your-prtg"
- $Username = "your-prtg-user"
- $Passhash = "the-users-passhash"
- $SourceSensorId = 5555 # The ID of the already configured sensor (as a template)
- $TargetDevice = 5612
- $response = [System.Net.WebRequest]::Create("http://$Server/api/duplicateobject.htm?id=$SourceSensorId&name=Test&targetid=$TargetDevice&username=$username&passhash=$passhash").GetResponse();
- # extract the sensor id, every number with at least 4 digits counts as id
- $newSensorID = $response.ResponseUri.Query -match "(\d{4,})";
- $newSensorID = $matches[0];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement