@@ -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"
0 commit comments