-
Notifications
You must be signed in to change notification settings - Fork 227
Add additional Report Server commands #2406
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
Merged
johlju
merged 11 commits into
dsccommunity:main
from
johlju:f/add-additional-rs-get-commands
Jan 13, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
be94b4f
Add additional Report Server commands
johlju a86073b
Update changelog and improve error handling in RS IP Address command
johlju cc27434
Add ReportServerIPAddress class to represent IP address entries
johlju 537f663
Enhance integration tests for Get-SqlDscRSIPAddress and Get-SqlDscRSE…
johlju db0af12
Refactor Get-SqlDscRSDatabaseInstallation to check result length and …
johlju dc74a24
Fix property names in Get-SqlDscRSDatabaseInstallation and update rel…
johlju 4ad1f48
Update Get-SqlDscRSDatabaseInstallation tests to handle GUIDs without…
johlju 932cfdd
debug
johlju 9979ebd
Remove unnecessary Get-Help call from Invoke-SqlDscQuery tests
johlju 531a5fb
Add mocked class loading and remove stub for Invoke-SqlDscQuery in Ge…
johlju 47f90f2
Refactor tests to replace Invoke-CimMethod with Invoke-RsCimMethod in…
johlju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,7 +109,8 @@ | |
| "hotfixes", | ||
| "checkpointing", | ||
| "HRESULT", | ||
| "RSDB" | ||
| "RSDB", | ||
| "RSIP" | ||
| ], | ||
| "cSpell.ignorePaths": [ | ||
| ".git" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Represents an IP address entry returned by the ListIPAddresses CIM method. | ||
|
|
||
| .DESCRIPTION | ||
| This class represents an IP address available on the report server machine, | ||
| including the IP version (V4 or V6) and whether it is DHCP-enabled. | ||
|
|
||
| .PARAMETER IPAddress | ||
| The IP address string. | ||
|
|
||
| .PARAMETER IPVersion | ||
| The version of the IP address. Values are 'V4' for IPv4 or 'V6' for IPv6. | ||
|
|
||
| .PARAMETER IsDhcpEnabled | ||
| Indicates whether the IP address is DHCP-enabled. If true, the IP address | ||
| is dynamic and should not be used for TLS bindings. | ||
|
|
||
| .EXAMPLE | ||
| [ReportServerIPAddress]::new() | ||
|
|
||
| Creates a new empty ReportServerIPAddress instance. | ||
|
|
||
| .EXAMPLE | ||
| $ipAddress = [ReportServerIPAddress]::new() | ||
| $ipAddress.IPAddress = '192.168.1.1' | ||
| $ipAddress.IPVersion = 'V4' | ||
| $ipAddress.IsDhcpEnabled = $false | ||
|
|
||
| Creates a new ReportServerIPAddress instance with property values. | ||
| #> | ||
| class ReportServerIPAddress | ||
| { | ||
| [System.String] | ||
| $IPAddress | ||
|
|
||
| [System.String] | ||
| $IPVersion | ||
|
|
||
| [System.Boolean] | ||
| $IsDhcpEnabled | ||
|
|
||
| ReportServerIPAddress() | ||
| { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Gets the report server installations registered in the database. | ||
|
|
||
| .DESCRIPTION | ||
| Gets the Reporting Services installations registered in the report | ||
| server database by calling the `ListReportServersInDatabase` method | ||
| on the `MSReportServer_ConfigurationSetting` CIM instance. | ||
|
|
||
| This command returns information about all report server installations | ||
| that are configured to use the same report server database, which is | ||
| useful in scale-out deployment scenarios. | ||
|
|
||
| The configuration CIM instance can be obtained using the | ||
| `Get-SqlDscRSConfiguration` command and passed via the pipeline. | ||
|
|
||
| .PARAMETER Configuration | ||
| Specifies the `MSReportServer_ConfigurationSetting` CIM instance for | ||
| the Reporting Services instance. This can be obtained using the | ||
| `Get-SqlDscRSConfiguration` command. This parameter accepts pipeline | ||
| input. | ||
|
|
||
| .EXAMPLE | ||
| Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Get-SqlDscRSDatabaseInstallation | ||
|
|
||
| Gets all report server installations registered in the database. | ||
|
|
||
| .EXAMPLE | ||
| $config = Get-SqlDscRSConfiguration -InstanceName 'SSRS' | ||
| Get-SqlDscRSDatabaseInstallation -Configuration $config | ||
|
|
||
| Gets report server installations using a stored configuration object. | ||
|
|
||
| .INPUTS | ||
| `Microsoft.Management.Infrastructure.CimInstance` | ||
|
|
||
| Accepts MSReportServer_ConfigurationSetting CIM instance via pipeline. | ||
|
|
||
| .OUTPUTS | ||
| `System.Management.Automation.PSCustomObject` | ||
|
|
||
| Returns objects with properties: InstallationID, MachineName, | ||
| InstanceName, and IsInitialized. | ||
|
|
||
| .NOTES | ||
| This command calls the CIM/WMI provider method `ListReportServersInDatabase` | ||
| using `Invoke-RsCimMethod`. | ||
|
|
||
| .LINK | ||
| https://docs.microsoft.com/en-us/sql/reporting-services/wmi-provider-library-reference/configurationsetting-method-listreportserversindatabase | ||
| #> | ||
| function Get-SqlDscRSDatabaseInstallation | ||
| { | ||
| [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseSyntacticallyCorrectExamples', '', Justification = 'Because the examples use pipeline input the rule cannot validate.')] | ||
| [CmdletBinding()] | ||
| [OutputType([System.Management.Automation.PSCustomObject])] | ||
| param | ||
| ( | ||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true)] | ||
| [System.Object] | ||
| $Configuration | ||
| ) | ||
|
|
||
| process | ||
| { | ||
| $instanceName = $Configuration.InstanceName | ||
|
|
||
| Write-Verbose -Message ($script:localizedData.Get_SqlDscRSDatabaseInstallation_Getting -f $instanceName) | ||
|
|
||
| $invokeRsCimMethodParameters = @{ | ||
| CimInstance = $Configuration | ||
| MethodName = 'ListReportServersInDatabase' | ||
| } | ||
|
|
||
| try | ||
| { | ||
| $result = Invoke-RsCimMethod @invokeRsCimMethodParameters -ErrorAction 'Stop' | ||
|
|
||
| <# | ||
| The WMI method returns: | ||
| - Length: Number of entries in the arrays | ||
| - InstallationID: Array of installation IDs | ||
| - MachineName: Array of machine names | ||
| - InstanceName: Array of instance names | ||
| - IsInitialized: Array of initialization states | ||
| #> | ||
| if ($result.Length -gt 0) | ||
| { | ||
| for ($i = 0; $i -lt $result.Length; $i++) | ||
| { | ||
| [PSCustomObject] @{ | ||
| InstallationID = $result.InstallationIDs[$i] | ||
| MachineName = $result.MachineNames[$i] | ||
| InstanceName = $result.InstanceNames[$i] | ||
| IsInitialized = $result.IsInitialized[$i] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| catch | ||
| { | ||
| $PSCmdlet.ThrowTerminatingError( | ||
| [System.Management.Automation.ErrorRecord]::new( | ||
| ($script:localizedData.Get_SqlDscRSDatabaseInstallation_FailedToGet -f $instanceName, $_.Exception.Message), | ||
| 'GSRSDI0001', | ||
| [System.Management.Automation.ErrorCategory]::InvalidOperation, | ||
| $Configuration | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.