diff --git a/CHANGELOG.md b/CHANGELOG.md index c83b93d895..184595a15a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,6 +97,9 @@ - BREAKING CHANGE: Parameters RSSQLServer and RSSQLInstanceName has been renamed to DatabaseServerName and DatabaseInstanceName respectively ([issue #923](https://github.com/PowerShell/SqlServerDsc/issues/923)). +- Changes to SqlDatabaseRole + - Added complete example for SqlRS (based on the integration tests) + ([issue #634](https://github.com/PowerShell/xSQLServer/issues/634)). - Changes to SqlServerConfiguration - BREAKING CHANGE: Parameters SQLServer and SQLInstanceName has been renamed to ServerName and InstanceName respectively diff --git a/Examples/Resources/xSQLServerRSConfig/3-CompleteWithTwoInstances.ps1 b/Examples/Resources/xSQLServerRSConfig/3-CompleteWithTwoInstances.ps1 new file mode 100644 index 0000000000..9085d930e1 --- /dev/null +++ b/Examples/Resources/xSQLServerRSConfig/3-CompleteWithTwoInstances.ps1 @@ -0,0 +1,139 @@ +<# +.EXAMPLE + This example performs a default SSRS configuration. It will initialize SSRS + and register default Report Server Web Service and Report Manager URLs: + http://localhost:80/ReportServer (Report Server Web Service) + http://localhost:80/Reports (Report Manager) +#> + +$ConfigurationData = @{ + AllNodes = @( + @{ + NodeName = 'localhost' + + # This is values used for the Reporting Services instance. + InstanceName = 'RS' + Features = 'RS' + + # This is values used for the Database Engine instance. + RSSQLServer = $env:COMPUTERNAME + RSSQLInstanceName = 'RSDB' + RSSQLFeatures = 'SQLENGINE' + RSSQLCollation = 'Finnish_Swedish_CI_AS' + + # This is values used for both instances. + MediaPath = 'Z:\Sql2016Media' + InstallSharedDir = 'C:\Program Files\Microsoft SQL Server' + InstallSharedWOWDir = 'C:\Program Files (x86)\Microsoft SQL Server' + UpdateEnabled = 'False' + BrowserSvcStartupType = 'Automatic' + + PSDscAllowPlainTextPassword = $true + } + ) +} + +Configuration Example +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.PSCredential] + $SqlAdministratorCredential, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.PSCredential] + $SqlInstallCredential, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.PSCredential] + $SqlServiceCredential, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.PSCredential] + $SqlAgentServiceCredential, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Management.Automation.PSCredential] + $ReportingServicesServiceCredential + ) + + Import-DscResource -ModuleName xSqlServer + + node localhost { + WindowsFeature 'NetFramework45' + { + Name = 'NET-Framework-45-Core' + Ensure = 'Present' + } + + xSQLServerSetup 'InstallDatabaseEngine' + { + InstanceName = $Node.RSSQLInstanceName + Features = $Node.RSSQLFeatures + SourcePath = $Node.MediaPath + BrowserSvcStartupType = $Node.BrowserSvcStartupType + SQLCollation = $Node.RSSQLCollation + SQLSvcAccount = $SqlServiceCredential + AgtSvcAccount = $SqlAgentServiceCredential + InstallSharedDir = $Node.InstallSharedDir + InstallSharedWOWDir = $Node.InstallSharedWOWDir + UpdateEnabled = $Node.UpdateEnabled + + SQLSysAdminAccounts = @( + $SqlAdministratorCredential.UserName + ) + + DependsOn = @( + '[WindowsFeature]NetFramework45' + ) + + PsDscRunAsCredential = $SqlInstallCredential + } + + xSQLServerSetup 'InstallReportingServicesInstance' + { + InstanceName = $Node.InstanceName + Features = $Node.Features + SourcePath = $Node.MediaPath + BrowserSvcStartupType = $Node.BrowserSvcStartupType + RSSvcAccount = $ReportingServicesServiceCredential + InstallSharedDir = $Node.InstallSharedDir + InstallSharedWOWDir = $Node.InstallSharedWOWDir + UpdateEnabled = $Node.UpdateEnabled + + SQLSysAdminAccounts = @( + $SqlAdministratorCredential.UserName + ) + + DependsOn = @( + '[WindowsFeature]NetFramework45' + '[xSQLServerSetup]InstallDatabaseEngine' + ) + + PsDscRunAsCredential = $SqlInstallCredential + } + + xSQLServerRSConfig 'ConfigureReportingServiceInstance' + { + # Instance name for the Reporting Services. + InstanceName = $Node.InstanceName + + # Instance for Reporting Services databases. + RSSQLServer = $Node.RSSQLServer + RSSQLInstanceName = $Node.RSSQLInstanceName + + PsDscRunAsCredential = $SqlInstallCredential + + DependsOn = @( + '[xSQLServerSetup]InstallReportingServicesInstance' + ) + } + } +} diff --git a/README.md b/README.md index 966e570722..6b06182d8e 100644 --- a/README.md +++ b/README.md @@ -698,6 +698,7 @@ Initializes and configures SQL Reporting Services server. * [Default configuration](Examples/Resources/SqlRS/1-DefaultConfiguration.ps1) * [Custom virtual directories and reserved URLs](Examples/Resources/SqlRS/2-CustomConfiguration.ps1) +* [Complete example with two instances in default configuration](/Examples/Resources/SqlRS/3-CompleteWithTwoInstances.ps1) ### SqlRSSecureConnectionLevel