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

xSQLServerRSConfig: Throws an error when two Reporting Services are installed for the same major version #819

Closed
johlju opened this Issue Sep 18, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@johlju
Collaborator

johlju commented Sep 18, 2017

Details of the scenario you tried and the problem that is occurring:
When two or more Reporting Services are installed (with different instance names) then the Get-TargetResource will return all instances.

This is because the instance name is not filtered out. Namespace does not help here.

The following will return

Get-WmiObject -Class MSReportServer_ConfigurationSetting -Namespace "root\Microsoft\SQLServer\ReportServer\RS_$InstanceName\v$sqlVersion\Admin"

will return

__GENUS                          : 2
__CLASS                          : MSReportServer_ConfigurationSetting
__SUPERCLASS                     : 
__DYNASTY                        : MSReportServer_ConfigurationSetting
__RELPATH                        : MSReportServer_ConfigurationSetting.InstanceName="SQL2016"
__PROPERTY_COUNT                 : 34
__DERIVATION                     : {}
__SERVER                         : APPVYR-WIN
__NAMESPACE                      : root\Microsoft\SQLServer\ReportServer\RS_DSCRS2016\v13\Admin
__PATH                           : \\APPVYR-WIN\root\Microsoft\SQLServer\ReportServer\RS_DSCRS2016\v13\Admin:MSReportServer_ConfigurationSetting.InstanceName="SQL2016"
ConnectionPoolSize               : 768
DatabaseLogonAccount             : 
DatabaseLogonTimeout             : -1
DatabaseLogonType                : 2
DatabaseName                     : ReportServer$SQL2016
DatabaseQueryTimeout             : 120
DatabaseServerName               : APPVYR-WIN\SQL2016
ExtendedProtectionLevel          : Off
ExtendedProtectionScenario       : Proxy
FileShareAccount                 : 
InstallationID                   : {2ea70394-9872-4c4e-bfdf-4a63c95b4f9b}
InstanceName                     : SQL2016
IsInitialized                    : False
IsPowerBIFeatureEnabled          : 
IsReportManagerEnabled           : True
IsSharePointIntegrated           : False
IsWebServiceEnabled              : True
IsWindowsServiceEnabled          : True
MachineAccountIdentity           : 
PathName                         : C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer\RSReportServer.config
SecureConnectionLevel            : 0
SenderEmailAddress               : 
SendUserName                     : 
SendUsingSMTPServer              : True
ServiceName                      : ReportServer$SQL2016
SMTPAuthenticate                 : 0
SMTPServer                       : 
SMTPUseSSL                       : False
UnattendedExecutionAccount       : 
Version                          : 
VirtualDirectoryReportManager    : Reports_SQL2016
VirtualDirectoryReportServer     : ReportServer_SQL2016
WindowsServiceIdentityActual     : NT Service\ReportServer$SQL2016
WindowsServiceIdentityConfigured : NT Service\ReportServer$SQL2016
PSComputerName                   : APPVYR-WIN

__GENUS                          : 2
__CLASS                          : MSReportServer_ConfigurationSetting
__SUPERCLASS                     : 
__DYNASTY                        : MSReportServer_ConfigurationSetting
__RELPATH                        : MSReportServer_ConfigurationSetting.InstanceName="DSCRS2016"
__PROPERTY_COUNT                 : 34
__DERIVATION                     : {}
__SERVER                         : APPVYR-WIN
__NAMESPACE                      : root\Microsoft\SQLServer\ReportServer\RS_DSCRS2016\v13\Admin
__PATH                           : \\APPVYR-WIN\root\Microsoft\SQLServer\ReportServer\RS_DSCRS2016\v13\Admin:MSReportServer_ConfigurationSetting.InstanceName="DSCRS2016"
ConnectionPoolSize               : 768
DatabaseLogonAccount             : 
DatabaseLogonTimeout             : -1
DatabaseLogonType                : 2
DatabaseName                     : 
DatabaseQueryTimeout             : 120
DatabaseServerName               : 
ExtendedProtectionLevel          : Off
ExtendedProtectionScenario       : Proxy
FileShareAccount                 : 
InstallationID                   : {cc4cd4c9-5138-43a9-8ab2-c641bb838591}
InstanceName                     : DSCRS2016
IsInitialized                    : False
IsPowerBIFeatureEnabled          : 
IsReportManagerEnabled           : True
IsSharePointIntegrated           : False
IsWebServiceEnabled              : True
IsWindowsServiceEnabled          : True
MachineAccountIdentity           : 
PathName                         : C:\Program Files\Microsoft SQL Server\MSRS13.DSCRS2016\Reporting Services\ReportServer\RSReportServer.config
SecureConnectionLevel            : 0
SenderEmailAddress               : 
SendUserName                     : 
SendUsingSMTPServer              : True
ServiceName                      : ReportServer$DSCRS2016
SMTPAuthenticate                 : 0
SMTPServer                       : 
SMTPUseSSL                       : False
UnattendedExecutionAccount       : 
Version                          : 13.0.1601.5
VirtualDirectoryReportManager    : 
VirtualDirectoryReportServer     : 
WindowsServiceIdentityActual     : APPVYR-WIN\svc-Reporting
WindowsServiceIdentityConfigured : APPVYR-WIN\svc-Reporting
PSComputerName                   : APPVYR-WIN

This is because Get-WmiObject is missing the filter parameter. So tghe Get-WmiObject call here

https://github.com/PowerShell/xSQLServer/blob/b2e553b2a2638fc88df1e815e4867f3733c7eed6/DSCResources/MSFT_xSQLServerRSConfig/MSFT_xSQLServerRSConfig.psm1#L44-L54

Should be

$reportingServicesConfiguration = Get-WmiObject -Class MSReportServer_ConfigurationSetting -Namespace "root\Microsoft\SQLServer\ReportServer\RS_$InstanceName\v$sqlVersion\Admin" -Filter "InstanceName = '$InstanceName'"

The DSC configuration that is using the resource (as detailed as possible):
Any configuration installing more than one Reporting Services using the same major version.

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2016, SQL Server 2016, WMF 5.1

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
SQLPS

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 19, 2017

Changes to xSQLServerRSConfig
- Fixed so that when two Reporting Services are installed for the same major
  version the resource does not throw an error (issue #819).

@johlju johlju added in progress and removed help wanted labels Sep 19, 2017

@johlju johlju self-assigned this Sep 19, 2017

johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 20, 2017

Changes to xSQLServerRSConfig
- Fixed so that when two Reporting Services are installed for the same major
  version the resource does not throw an error (issue #819).

@johlju johlju closed this in #827 Sep 20, 2017

johlju added a commit that referenced this issue Sep 20, 2017

xSQLServerRSConfig: Throws for two Reporting Services with same major…
… version (#827)

- Changes to xSQLServerRSConfig
  - Fixed so that when two Reporting Services are installed for the same major
    version the resource does not throw an error (issue #819).

@johlju johlju removed the in progress label Sep 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment