Skip to content

Commit 14838a7

Browse files
Install-DbaInstance - Add ASAdminAccount parameter for Analysis Services administrators (#9973)
1 parent fbe365b commit 14838a7

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

public/Install-DbaInstance.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ function Install-DbaInstance {
142142
Defaults to the current user or the account specified in the Credential parameter.
143143
Use domain\\username format for domain accounts or computername\\username for local accounts.
144144
145+
.PARAMETER ASAdminAccount
146+
Specifies one or more Windows accounts to grant administrator privileges on Analysis Services.
147+
Required when installing Analysis Services feature. At least one administrator account must be specified.
148+
Use domain\\username format for domain accounts or computername\\username for local accounts.
149+
145150
.PARAMETER Port
146151
Specifies the TCP port number for SQL Server after installation, overriding the default port 1433.
147152
The function configures the port post-installation since SQL Server setup doesn't directly support custom ports.
@@ -299,6 +304,14 @@ function Install-DbaInstance {
299304
300305
Run the installation locally with default settings overriding the value of specific configuration items.
301306
Instance name will be defined as 'v2017'; TCP port will be changed to 1337 after installation.
307+
308+
.Example
309+
PS C:\> $svcAcc = Get-Credential MyDomain\SvcSqlServer
310+
PS C:\> Install-DbaInstance -Version 2022 -Feature Engine,AnalysisServices -AdminAccount "AD\MSSQLAdmins" -ASAdminAccount "AD\SSASAdmins" -EngineCredential $svcAcc -ASCredential $svcAcc
311+
312+
Install SQL Server 2022 with Database Engine and Analysis Services features.
313+
Grants sysadmin rights to AD\MSSQLAdmins on the Database Engine and administrator rights to AD\SSASAdmins on Analysis Services.
314+
Uses MyDomain\SvcSqlServer as the service account for both services.
302315
#>
303316
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
304317
param (
@@ -331,6 +344,7 @@ function Install-DbaInstance {
331344
[string]$BackupPath,
332345
[string]$UpdateSourcePath,
333346
[string[]]$AdminAccount,
347+
[string[]]$ASAdminAccount,
334348
[int]$Port,
335349
[int]$Throttle = 50,
336350
[Alias('PID')]
@@ -798,6 +812,9 @@ function Install-DbaInstance {
798812
if (Test-Bound -ParameterName AdminAccount) {
799813
$configNode.SQLSYSADMINACCOUNTS = ($AdminAccount | ForEach-Object { '"{0}"' -f $_ }) -join ' '
800814
}
815+
if (Test-Bound -ParameterName ASAdminAccount) {
816+
$configNode.ASSYSADMINACCOUNTS = ($ASAdminAccount | ForEach-Object { '"{0}"' -f $_ }) -join ' '
817+
}
801818
if (Test-Bound -ParameterName UpdateSourcePath) {
802819
$configNode.UPDATESOURCE = $UpdateSourcePath
803820
$configNode.UPDATEENABLED = "True"

tests/Install-DbaInstance.Tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Describe $CommandName -Tag UnitTests {
2929
"BackupPath",
3030
"UpdateSourcePath",
3131
"AdminAccount",
32+
"ASAdminAccount",
3233
"Port",
3334
"Throttle",
3435
"ProductID",

0 commit comments

Comments
 (0)