Skip to content

Instantly share code, notes, and snippets.

@mbrownnycnyc
Created December 14, 2015 17:11
Show Gist options
  • Save mbrownnycnyc/06427daa3f19a2e6c850 to your computer and use it in GitHub Desktop.
Save mbrownnycnyc/06427daa3f19a2e6c850 to your computer and use it in GitHub Desktop.
#schtasks /create /tn "SSRS Recycle" /ru UserName /rl highest /np /sc daily /sd 08/01/2011 /st 02:00 /tr "powershell.exe -noprofile -executionpolicy RemoteSigned -file c:scriptsSSRSRecycle.ps1"
#http://www.pawlowski.cz/2011/07/solving-issue-long-starting-report-ssrs-2008/#comment-307
$wc = new-Object System.Net.WebClient
$httpRequest = [System.Net.HttpWebRequest]::Create("http://localhost/Reports/Pages/Folder.aspx")
$httpRequest.Credentials =[System.Net.CredentialCache]::DefaultCredentials
$httpRequest.UnsafeAuthenticatedConnectionSharing = "true"
$httpRequest.Method = "GET"
# https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.timeout%28v=vs.110%29.aspx
#set timeout to 10 mins
$httpRequest.Timeout = 600000
$objResponseReader = [System.IO.StreamReader]($httpRequest.GetResponse().GetResponseStream())
$httpResponse = $objResponseReader.ReadToEnd().ToString()
$httpResponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment