Skip to content

Commit

Permalink
SqlSetup: Added ASServerMode parameter (dsccommunity#964)
Browse files Browse the repository at this point in the history
- Changes to SqlSetup
  - Added parameter `ASServerMode` to support installing Analysis Services in
    Multidimensional mode, Tabular mode and PowerPivot mode (issue dsccommunity#388).
  - Added integration tests for testing Analysis Services Multidimensional mode
    and Tabular mode.
  • Loading branch information
johlju authored Dec 25, 2017
1 parent 4e919b4 commit 686c1d5
Show file tree
Hide file tree
Showing 8 changed files with 355 additions and 54 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
([issue #930](https://github.com/PowerShell/SqlServerDsc/issues/930)).
- Made the description of parameter RestartService more descriptive
([issue #960](https://github.com/PowerShell/SqlServerDsc/issues/960)).
- Changes to SqlSetup
- Added parameter `ASServerMode` to support installing Analysis Services in
Multidimensional mode, Tabular mode and PowerPivot mode
([issue #388](https://github.com/PowerShell/SqlServerDsc/issues/388)).
- Added integration tests for testing Analysis Services Multidimensional mode
and Tabular mode.

## 10.0.0.0

Expand Down
42 changes: 42 additions & 0 deletions DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@ function Get-TargetResource
$analysisLogDirectory = $analysisServer.ServerProperties['LogDir'].Value
$analysisBackupDirectory = $analysisServer.ServerProperties['BackupDir'].Value

<#
The property $analysisServer.ServerMode.value__ contains the
server mode (aka deployment mode) value 0, 1 or 2. See DeploymentMode
here https://docs.microsoft.com/en-us/sql/analysis-services/server-properties/general-properties.
The property $analysisServer.ServerMode contains the display name of
the property value__. See more information here
https://msdn.microsoft.com/en-us/library/microsoft.analysisservices.core.server.servermode.aspx.
#>
$analysisServerMode = $analysisServer.ServerMode.ToString().ToUpper()

$analysisSystemAdminAccounts = [System.String[]] $analysisServer.Roles['Administrators'].Members.Name

$analysisConfigDirectory = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\$analysisServiceName" -Name 'ImagePath').ImagePath.Replace(' -s ',',').Split(',')[1].Trim('"')
Expand Down Expand Up @@ -487,6 +498,7 @@ function Get-TargetResource
ASBackupDir = $analysisBackupDirectory
ASTempDir = $analysisTempDirectory
ASConfigDir = $analysisConfigDirectory
ASServerMode = $analysisServerMode
ISSvcAccountUsername = $integrationServiceAccountUsername
FailoverClusterGroupName = $clusteredSqlGroupName
FailoverClusterNetworkName = $clusteredSqlHostname
Expand Down Expand Up @@ -619,6 +631,13 @@ function Get-TargetResource
.PARAMETER ASConfigDir
Path for Analysis Services config.
.PARAMETER ASServerMode
The server mode for SQL Server Analysis Services instance. The default is
to install in Multidimensional mode. Valid values in a cluster scenario
are MULTIDIMENSIONAL or TABULAR. Parameter ASServerMode is case-sensitive.
All values must be expressed in upper case.
{ MULTIDIMENSIONAL | TABULAR | POWERPIVOT }.
.PARAMETER ISSvcAccount
Service account for Integration Services service.
Expand Down Expand Up @@ -797,6 +816,11 @@ function Set-TargetResource
[System.String]
$ASConfigDir,

[Parameter()]
[ValidateSet('MULTIDIMENSIONAL','TABULAR','POWERPIVOT', IgnoreCase = $false)]
[System.String]
$ASServerMode,

[Parameter()]
[System.Management.Automation.PSCredential]
$ISSvcAccount,
Expand Down Expand Up @@ -1244,6 +1268,12 @@ function Set-TargetResource
'ASConfigDir'
)


if ($PSBoundParameters.ContainsKey('ASServerMode'))
{
$setupArguments['ASServerMode'] = $ASServerMode
}

if ($PSBoundParameters.ContainsKey('ASSvcAccount'))
{
$setupArguments += (Get-ServiceAccountParameters -ServiceAccount $ASSvcAccount -ServiceType 'AS')
Expand Down Expand Up @@ -1540,6 +1570,13 @@ function Set-TargetResource
.PARAMETER ASConfigDir
Path for Analysis Services config.
.PARAMETER ASServerMode
The server mode for SQL Server Analysis Services instance. The default is
to install in Multidimensional mode. Valid values in a cluster scenario
are MULTIDIMENSIONAL or TABULAR. Parameter ASServerMode is case-sensitive.
All values must be expressed in upper case.
{ MULTIDIMENSIONAL | TABULAR | POWERPIVOT }.
.PARAMETER ISSvcAccount
Service account for Integration Services service.
Expand Down Expand Up @@ -1717,6 +1754,11 @@ function Test-TargetResource
[System.String]
$ASConfigDir,

[Parameter()]
[ValidateSet('MULTIDIMENSIONAL','TABULAR','POWERPIVOT', IgnoreCase = $false)]
[System.String]
$ASServerMode,

[Parameter()]
[System.Management.Automation.PSCredential]
$ISSvcAccount,
Expand Down
1 change: 1 addition & 0 deletions DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class MSFT_SqlSetup : OMI_BaseResource
[Write, Description("Path for Analysis Services backup files.")] String ASBackupDir;
[Write, Description("Path for Analysis Services temp files.")] String ASTempDir;
[Write, Description("Path for Analysis Services config.")] String ASConfigDir;
[Write, Description("The server mode for SQL Server Analysis Services instance. The default is to install in Multidimensional mode. Valid values in a cluster scenario are MULTIDIMENSIONAL or TABULAR. Parameter ASServerMode is case-sensitive. All values must be expressed in upper case."), ValueMap{"MULTIDIMENSIONAL", "TABULAR", "POWERPIVOT"}, Values{"MULTIDIMENSIONAL", "TABULAR", "POWERPIVOT"}] String ASServerMode;
[Write, EmbeddedInstance("MSFT_Credential"), Description("Service account for Integration Services service.")] String ISSvcAccount;
[Read, Description("Output username for the Integration Services service.")] String ISSvcAccountUsername;
[Write, Description("Specifies the startup mode for SQL Server Browser service."), ValueMap{"Automatic", "Disabled", "Manual"}, Values{"Automatic", "Disabled", "Manual"}] String BrowserSvcStartupType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<#
.EXAMPLE
This example shows how to install a default instance of SQL Server on a single server.
This example shows how to install a default instance of SQL Server, and
Analysis Services in Tabular mode, on a single server.
.NOTES
SQL Server setup is run using the SYSTEM account. Even if SetupCredential is provided
it is not used to install SQL Server at this time (see issue #139).
Expand Down Expand Up @@ -74,6 +75,7 @@ Configuration Example
SQLTempDBDir = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Data'
SQLTempDBLogDir = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Data'
SQLBackupDir = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup'
ASServerMode = 'TABULAR'
ASConfigDir = 'C:\MSOLAP\Config'
ASDataDir = 'C:\MSOLAP\Data'
ASLogDir = 'C:\MSOLAP\Log'
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,11 @@ installing feature Database Engine and Analysis Services respectively.
* **`[String]` ASBackupDir** _(Write)_: Path for Analysis Services backup files.
* **`[String]` ASTempDir** _(Write)_: Path for Analysis Services temp files.
* **`[String]` ASConfigDir** _(Write)_: Path for Analysis Services config.
* **`[String]` ASServerMode** _(Write)_: The server mode for SQL Server Analysis
Services instance. The default is to install in Multidimensional mode. Valid
values in a cluster scenario are MULTIDIMENSIONAL or TABULAR. Parameter
ASServerMode is case-sensitive. All values must be expressed in upper case.
{ MULTIDIMENSIONAL | TABULAR | POWERPIVOT }.
* **`[PSCredential]` ISSvcAccount** _(Write)_: Service account for Integration
Services service.
* **`[String]` BrowserSvcStartupType** _(Write)_: Specifies the startup mode for
Expand Down
Loading

0 comments on commit 686c1d5

Please sign in to comment.