Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - param([int]$sensorid, [string]$database,[string]$host,[string]$username,[string]$password)
 - $PRTGServer = "";
 - $PRTGPort = 80;
 - $PRTGProtocol = "http";
 - $PRTGUser = "prtgadmin";
 - $PRTGPassHash = "";
 - # Get the current sensor comment into a variable
 - [XML]$CurrentComment = (New-Object System.Net.WebClient).DownloadString("$($PRTGprotocol)://$($PRTGserver):$($PRTGport)/api/getobjectproperty.htm?id=$($SensorID)&name=Comments&username=$($PRTGuser)&passhash=$($PRTGpasshash)")
 - $StoredProcedureCall = $CurrentComment.prtg.result
 - $Result = (Start-Process -FilePath "C:\Sensors\SQLspXML.exe" -ArgumentList "-Input -d=$($database) -sp='CALL $($StoredProcedureCall)' -s=$($host) -u=$($username) -p=$($password)");
 - $Result
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment