0

I need to access an import script located at "http://site.com/script.aspx", and I have currently setup up a powershell script doing this, the problem is the script probably takes 10minuttes to finish, and this causes the GetResponse to tiemout with : "GetResponse" with "0" argument(s): "The operation has timed out"

$global:url= "http://site.com/script.aspx"
#$myHttpWebRequest = [system.net.WebRequest]::Create($url)
#$myHttpWebRequest.Timeout = 600000 # dosent seem to do whats needed
#$myHttpWebResponse = $myHttpWebRequest.GetResponse()

How do I solve this problem?

2
  • Do you have to go through a proxy to reach the internet on your network? If so, how is this configured for the user account under which your task is executing? Commented Feb 20, 2013 at 13:35
  • No, not going through a proxy. Commented Feb 21, 2013 at 8:52

2 Answers 2

1

If I am reading this right, the PowerShell script is making a request to script.aspx that runs for 10 minutes at which point the web request throws an exception stating that the request has reached the timeout limit and has been terminated?

If so, this is not something that PowerShell has any control over. That is controlled (probably) by a setting on the server at site.com. I would start by looking at the web.config file for that script.aspx page.

<configuration>
  <system.web>
    <!-- increase timeout to 15 minutes -->
    <httpRuntime executionTimeout="900" />
  </system.web>
</configuration>

Reference: http://msdn.microsoft.com/en-us/library/e1f13641%28v=vs.100%29.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer, but I dont have any direct access to modifying site.com, so that solution wouldnt fit me.
0

I dropped using powershell, and instead got wget running from a batch file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.