解決RS每天第一次登入太慢的問題

摘要:解決RS每天第一次登入太慢的問題

解決RS每天第一次登入太慢的問題.zip

一、               建立PowerShell script檔案,C:\scripts\SSRSRecycle.ps1

(1)   先停止RS Services

(2)   先啟動RS Services

(3)   模擬登入報表管理畫面

語法為:

Stop-Service "SQL Server Reporting Services (MSSQLSERVER)"

Start-Service "SQL Server Reporting Services (MSSQLSERVER)"

$wc = New-Object system.net.webClient

$cred = [System.Net.CredentialCache]::DefaultNetworkCredentials

$wc.Credentials = $cred

 $src = $wc.DownloadString("http://localhost/Reports/Pages/Folder.aspx")

【測試完成畫面】

若要允許執行已簽署的指令碼

在PowerShell console下執行

PS C:\> Set-ExecutionPolicy RemoteSigned

 

 

二、               建立Windows工作排程

在系統管理員執行:

C:\>schtasks /create /tn "SSRS Recycle" /ru 009577 /rl highest /np /sc daily /sd 2014/07/07 /st 03:00 /tr "powershell.exe -noprofile -executionpolicy RemoteSigned -file c:scriptsSSRSRecycle.ps1"

排定每天早上二點啟動工作排程

 

三、               修改C:\Program Files\Microsoft SQL Server\MSRS11\Reporting Services\ReportServer\rsreportserver.config

 

   將RecycleTime改成1500分鐘25小時