Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 如何自动化SSRS配置_Reporting Services_Tfs_Automation - Fatal编程技术网

Reporting services 如何自动化SSRS配置

Reporting services 如何自动化SSRS配置,reporting-services,tfs,automation,Reporting Services,Tfs,Automation,这是我的场景:我必须设置多个TFS 2013应用层节点(至少6个),并且我正在尝试自动化该过程,这些节点还以“群集”(更好的组)配置承载SQL Server Reporting Services 2012 SP1。我在安装SQL方面没有问题,但我仍然坚持使用Reporting Services配置 使用WMI配置URL的状态,并且该类有一个似乎合适的SetVirtualDirectory。我看到RS Configuration Manager中的值发生了更改,但是消息 未配置报表服务器Web服务

这是我的场景:我必须设置多个TFS 2013应用层节点(至少6个),并且我正在尝试自动化该过程,这些节点还以“群集”(更好的组)配置承载SQL Server Reporting Services 2012 SP1。我在安装SQL方面没有问题,但我仍然坚持使用Reporting Services配置

使用WMI配置URL的状态,并且该类有一个似乎合适的SetVirtualDirectory。我看到RS Configuration Manager中的值发生了更改,但是消息

未配置报表服务器Web服务

不要消失

我的Powershell代码是

$wmiName = (Get-WmiObject –namespace root\Microsoft\SqlServer\ReportServer  –class __Namespace).Name
$rsConfig = Get-WmiObject –namespace "root\Microsoft\SqlServer\ReportServer\$wmiName\v11\Admin" -class MSReportServer_ConfigurationSetting  -filter "InstanceName='SQLTFS'"

CheckHResult $rsConfig.SetVirtualDirectory("ReportServerWebService","ReportServer",0)
CheckHResult $rsConfig.SetVirtualDirectory("ReportManager","Reports",0)
CheckHResult $rsConfig.SetDatabaseConnection($DatabaseInstance, $DatabaseName, 2, $SqlCredential.UserName, $SqlCredential.GetNetworkCredential().Password)
# force refresh
CheckHResult $rsConfig.SetServiceState($false,$false,$false)
Restart-Service $rsConfig.ServiceName
CheckHResult $rsConfig.SetServiceState($true,$true,$true)
# set key
& "$SQLBin\RSKeyMgmt.exe" -a -i SQLTFS -f $SSRSEncryptKeyFile -p $SSRSEncryptPassword
# join group
& "$SQLBin\RSKeyMgmt.exe" -j -m $workingNode -i SQLTFS -n SQLTFS

找到罪魁祸首:需要调用ReserveURL并使用URL的
http://+:80
语法。调用此API将重新启动服务,以便可能需要一段时间才能响应

新版本的脚本是

$wmiName = (Get-WmiObject –namespace root\Microsoft\SqlServer\ReportServer  –class __Namespace).Name

$rsConfig = Get-WmiObject –namespace "root\Microsoft\SqlServer\ReportServer\$wmiName\v11\Admin" -class MSReportServer_ConfigurationSetting -filter "InstanceName='SQLTFS'"
CheckHResult $rsConfig.SetDatabaseConnection($DatabaseInstance, $DatabaseName, 2, $SqlCredential.UserName, $SqlCredential.GetNetworkCredential().Password)

CheckHResult $rsConfig.SetVirtualDirectory("ReportServerWebService","ReportServer",$lcid)
CheckHResult $rsConfig.ReserveURL("ReportServerWebService","http://+:80",$lcid)
CheckHResult $rsConfig.SetVirtualDirectory("ReportManager","Reports",$lcid)
CheckHResult $rsConfig.ReserveURL("ReportManager","http://+:80",$lcid)

Start-Sleep -Seconds 15
# set key
& "$SQLBin\RSKeyMgmt.exe" -a -i SQLTFS -f $SSRSEncryptKeyFile -p $SSRSEncryptPassword
Start-Sleep -Seconds 15
# join group
& "$SQLBin\RSKeyMgmt.exe" -j -m $workingNode -i SQLTFS -n SQLTFS
Start-Sleep -Seconds 15

CheckHResult $rsConfig.SetServiceState($true,$true,$true)

找到罪魁祸首:需要调用ReserveURL并使用URL的
http://+:80
语法。调用此API将重新启动服务,以便可能需要一段时间才能响应

新版本的脚本是

$wmiName = (Get-WmiObject –namespace root\Microsoft\SqlServer\ReportServer  –class __Namespace).Name

$rsConfig = Get-WmiObject –namespace "root\Microsoft\SqlServer\ReportServer\$wmiName\v11\Admin" -class MSReportServer_ConfigurationSetting -filter "InstanceName='SQLTFS'"
CheckHResult $rsConfig.SetDatabaseConnection($DatabaseInstance, $DatabaseName, 2, $SqlCredential.UserName, $SqlCredential.GetNetworkCredential().Password)

CheckHResult $rsConfig.SetVirtualDirectory("ReportServerWebService","ReportServer",$lcid)
CheckHResult $rsConfig.ReserveURL("ReportServerWebService","http://+:80",$lcid)
CheckHResult $rsConfig.SetVirtualDirectory("ReportManager","Reports",$lcid)
CheckHResult $rsConfig.ReserveURL("ReportManager","http://+:80",$lcid)

Start-Sleep -Seconds 15
# set key
& "$SQLBin\RSKeyMgmt.exe" -a -i SQLTFS -f $SSRSEncryptKeyFile -p $SSRSEncryptPassword
Start-Sleep -Seconds 15
# join group
& "$SQLBin\RSKeyMgmt.exe" -j -m $workingNode -i SQLTFS -n SQLTFS
Start-Sleep -Seconds 15

CheckHResult $rsConfig.SetServiceState($true,$true,$true)

我在数据中心工作,在发现这种方法之前,我使用autoit程序配置SSRS实例

我想添加到这个解决方案中的是配置SSL,它可以按如下方式完成

$certhash = Get-ChildItem -path cert:\localmachine\my | Where {$_.subject -match <yourdomain> } | select -ExpandProperty thumbprint
$certhash = $certhash.tolower() #important
$sslPort = 443
$sslUrl = "https://+:443/"
$lcid = 1033 # for english


$rsConfig.ReserveURL("ReportServerWebService", $sslUrl, $lcid)
$rsConfig.CreateSSLCertificateBinding("ReportServerWebService", $certHash, "0.0.0.0", $sslPort, $lcid)

$rsConfig.ReserveURL("ReportManager", $sslUrl, $lcid)
$rsConfig.CreateSSLCertificateBinding("ReportManager", $certHash, "0.0.0.0", $sslPort, $lcid)

# Stop and Start SQL Server's Reporting Services to ensure changes take affect
$rsconfig.SetServiceState($false, $false, $false)
$rsconfig.SetServiceState($true, $true, $true)
$certhash=Get ChildItem-path cert:\localmachine\my | Where{$\.subject-match}| select-ExpandProperty指纹
$certhash=$certhash.tolower()#重要
$sslPort=443
$sslUrl=“https://+:443/”
$lcid=1033(英语)
$rsConfig.ReserveURL(“ReportServerWebService”、$sslUrl、$lcid)
$rsConfig.CreateSSLCertificateBinding(“ReportServerWebService”、$certHash、“0.0.0.0”、$sslPort、$lcid)
$rsConfig.ReserveURL(“ReportManager”、$sslUrl、$lcid)
$rsConfig.CreateSSLCertificateBinding(“ReportManager”、$certHash、“0.0.0.0”、$sslPort、$lcid)
#停止并启动SQL Server的Reporting Services,以确保更改生效
$rsconfig.SetServiceState($false、$false、$false)
$rsconfig.SetServiceState($true、$true、$true)
其他一些非常有用的资源包括


我在数据中心工作,在发现这种方法之前,我使用autoit程序配置SSRS实例

我想添加到这个解决方案中的是配置SSL,它可以按如下方式完成

$certhash = Get-ChildItem -path cert:\localmachine\my | Where {$_.subject -match <yourdomain> } | select -ExpandProperty thumbprint
$certhash = $certhash.tolower() #important
$sslPort = 443
$sslUrl = "https://+:443/"
$lcid = 1033 # for english


$rsConfig.ReserveURL("ReportServerWebService", $sslUrl, $lcid)
$rsConfig.CreateSSLCertificateBinding("ReportServerWebService", $certHash, "0.0.0.0", $sslPort, $lcid)

$rsConfig.ReserveURL("ReportManager", $sslUrl, $lcid)
$rsConfig.CreateSSLCertificateBinding("ReportManager", $certHash, "0.0.0.0", $sslPort, $lcid)

# Stop and Start SQL Server's Reporting Services to ensure changes take affect
$rsconfig.SetServiceState($false, $false, $false)
$rsconfig.SetServiceState($true, $true, $true)
$certhash=Get ChildItem-path cert:\localmachine\my | Where{$\.subject-match}| select-ExpandProperty指纹
$certhash=$certhash.tolower()#重要
$sslPort=443
$sslUrl=“https://+:443/”
$lcid=1033(英语)
$rsConfig.ReserveURL(“ReportServerWebService”、$sslUrl、$lcid)
$rsConfig.CreateSSLCertificateBinding(“ReportServerWebService”、$certHash、“0.0.0.0”、$sslPort、$lcid)
$rsConfig.ReserveURL(“ReportManager”、$sslUrl、$lcid)
$rsConfig.CreateSSLCertificateBinding(“ReportManager”、$certHash、“0.0.0.0”、$sslPort、$lcid)
#停止并启动SQL Server的Reporting Services,以确保更改生效
$rsconfig.SetServiceState($false、$false、$false)
$rsconfig.SetServiceState($true、$true、$true)
其他一些非常有用的资源包括


所以,我刚刚找到了一个PowerShell模块,通过脚本帮助进行配置。在封面下,它使用WMI并且不完整(没有证书方法),但它比以前简洁得多

来自Microsoft的模块:

最后,如果您的设置需要SSL,下面的代码应该会有所帮助。它的灵感来自于


请注意,不同版本的SSRS的脚本略有不同,因此您的里程数可能有所不同。

因此,我刚刚找到了一个PowerShell模块,通过脚本帮助您进行配置。在封面下,它使用WMI并且不完整(没有证书方法),但它比以前简洁得多

来自Microsoft的模块:

最后,如果您的设置需要SSL,下面的代码应该会有所帮助。它的灵感来自于

注意,不同版本的SSRS的脚本略有不同,因此您的里程可能会有所不同