在PowerShell中调用SSRS报告并注册SSRS事件日志条目

在PowerShell中调用SSRS报告并注册SSRS事件日志条目,powershell,reporting-services,Powershell,Reporting Services,需要:调用SSRS报告(SSRS 2012)的PowerShell脚本,以便在SSRS的ExecutionLog3(SSRS的日志数据库视图)中查看时,web调用显示为常规交互请求 问题:我已经修改了以下脚本,试图找出强制SSRS服务器记录调用所需的参数,就像它来自人工/浏览器一样。这个脚本很好用。我已连接并获得所有3种方法的响应,但SSRS根本没有记录它。如果我在IE/Chrome中手动调用相同的报告,SSRS会相应地正确地记录它 我在Chrome中使用了F12工具,看看是否可以找到一些JS代

需要:调用SSRS报告(SSRS 2012)的PowerShell脚本,以便在SSRS的ExecutionLog3(SSRS的日志数据库视图)中查看时,web调用显示为常规交互请求

问题:我已经修改了以下脚本,试图找出强制SSRS服务器记录调用所需的参数,就像它来自人工/浏览器一样。这个脚本很好用。我已连接并获得所有3种方法的响应,但SSRS根本没有记录它。如果我在IE/Chrome中手动调用相同的报告,SSRS会相应地正确地记录它

我在Chrome中使用了F12工具,看看是否可以找到一些JS代码,这些代码实际上是在做日志注册请求,唉,对我来说太高级了

想法

    # My AdventureWorks Sales Order Detail (.rpl) requires no parameters.

$RS1 = $null
$RS2 = $null
$RS3 = $null

# Try using the direct URL of the report approach 
$Uri1 = 'http://reportstest.domain.com/home/report/AdventureWorks-Test/Sales%20Orders/Sales%20Order%20Detail.rdl'
# Try using the ReportViewer.aspx followed by path & variables approach
$Uri2 = 'http://reportstest.domain.com/Service/Pages/ReportViewer.aspx?%2fAdventureWorks-Test%2fSales+Orders%2fSales+Order+Detail&rc:Command=Render'
# Try using the Service approach
$Uri3 = 'http://reportstest.domain.com/Service?/AdventureWorks-Test%2fSales+Orders%2fSales+Order+Detail'

# Try each Uri to see if we create an entry in SSRS's ExecutionLog3
$RS1 = Invoke-WebRequest -Uri $Uri1 -UseDefaultCredentials -DisableKeepAlive
$RS2 = Invoke-WebRequest -Uri $Uri2 -UseDefaultCredentials -DisableKeepAlive
$RS3 = Invoke-WebRequest -Uri $Uri3 -UseDefaultCredentials -DisableKeepAlive

# See the response for each attempt, check for '200'
$RS1.StatusCode
$RS2.StatusCode
$RS3.StatusCode

200人的回答似乎并不是全部。您可能需要采取不同的方法。看看这个问题的答案:200的回答似乎并不是全部。您可能需要采取不同的方法。请参见此问题的答案: