ps/Modules/Alkami.DevOps.SqlReports/Public/Get-SSRSDatabaseServer.ps1

32 lines
910 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Get-SSRSDatabaseServer {
<#
.SYNOPSIS
Retrieves the configured ReportServer name from an SSRS Server.
.DESCRIPTION
Generally, this is the same name as the server that is queried, but this adds an additional layer of checking.
.PARAMETER ReportServer
[string] The server name to be queried. Required.
.EXAMPLE
Get-SSRSDatabaseServer "sc00rs01.fh.local"
.EXAMPLE
Get-SSRSDatabaseServer -ReportServer "sc00rs01.fh.local"
.NOTES
This requires the calling user to have sysadmin rights to the SSRS server
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[Alias("ReportServer")]
[string]$server
)
$proxy = New-SSRSProxy "http://$server/ReportServer"
$configInfo = [xml]$proxy.GetReportServerConfigInfo($false)
return $configInfo.ServerConfigInfo.Server.MachineName
}