Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-SqlDscReportingsServicesConfiguration: New command proposal #2013

Open
johlju opened this issue May 4, 2024 · 0 comments
Open

Get-SqlDscReportingsServicesConfiguration: New command proposal #2013

johlju opened this issue May 4, 2024 · 0 comments
Labels
command proposal The issue is proposing to add a new command to the module. help wanted The issue is up for grabs for anyone in the community.

Comments

@johlju
Copy link
Member

johlju commented May 4, 2024

Command proposal

Returns an object containing the configuration of the specified Reporting Services instance.

Proposed parameters

Parameter Mandatory Data type Description Default value Allowed values
InstanceName Yes String Name of the SQL Server Reporting Services instance to be configured. SSRS

Special considerations or limitations

Could use the code here:

$instanceNamesRegistryKey = 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\RS'
if (Get-ItemProperty -Path $instanceNamesRegistryKey -Name $InstanceName -ErrorAction SilentlyContinue)
{
$instanceId = (Get-ItemProperty -Path $instanceNamesRegistryKey -Name $InstanceName).$InstanceName
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$instanceId\MSSQLServer\CurrentVersion")
{
# SQL Server 2017 and 2019 SSRS stores current SQL Server version to a different Registry path.
$sqlVersion = [int]((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$InstanceId\MSSQLServer\CurrentVersion" -Name 'CurrentVersion').CurrentVersion).Split('.')[0]
}
else
{
$sqlVersion = [int]((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$instanceId\Setup" -Name 'Version').Version).Split('.')[0]
}
$reportingServicesConfiguration = Get-CimInstance -ClassName MSReportServer_ConfigurationSetting -Namespace "root\Microsoft\SQLServer\ReportServer\RS_$InstanceName\v$sqlVersion\Admin"
$reportingServicesConfiguration = $reportingServicesConfiguration | Where-Object -FilterScript {
$_.InstanceName -eq $InstanceName
}

@johlju johlju added help wanted The issue is up for grabs for anyone in the community. command proposal The issue is proposing to add a new command to the module. labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command proposal The issue is proposing to add a new command to the module. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

1 participant