In active batch, I have a report that runs using a Powershell script. The script looks like this:
$wc=new-object system.net.webclient -ErrorVariable err
$wc.UseDefaultCredentials = $true
$url = "http://SSRS-SERVER/etc...&rs:Command=Render&rs:Format=EXCEL"
$file = "ReportName.xls"
echo $url
echo $file
$wc.downloadfile($url,$file)
$err.count
$err
This script runs perfectly fine when it's quicker than 1 min and 40 seconds, which I've read the default timeout for webclient is 100 - so that makes sense.
I've tried adding:
$wc.Timeout = 500
But no luck. It says:
Property 'Timeout' cannot be found on this object; make sure it exists and is settable.
Can someone please let me know how to extend the timeout period on this script?