Hi Stephan,
I ran into another problem. I tried to download the report page via powershell but it would then redirected me to prtg login page. I tried both web-request method and create an ie object, but neither of them work. Is there a way I can get the report without manually logon and download it?
web-request method:
$R = Invoke-WebRequest $prtglink -SessionVariable test
$test
$Form = $R.Forms[0]
$Form | Format-List
$Form.fields
$Form.Fields["loginusername"] = "$username"
$Form.Fields["loginpassword"] = "$password"
$R = Invoke-WebRequest -Uri ("$prtglink" + $Form.Action) -WebSession $test -Method POST -Body $Form.Fields
$R.Content
#R.content showing login page
create an ie object:
$reportlink = "$prtglink/config_report_users.htm"
$ie = new-object -com "InternetExplorer.Application"
$ie.Visible = $true
$ie.Navigate("$reportlink")
While ($ie.Busy) {
Sleep 2
}
$doc = $ie.Document
#$doc return null
Add comment