Last active
October 24, 2020 20:27
-
-
Save jpomfret/9e110fd6aa220b1f245945becceb90fb to your computer and use it in GitHub Desktop.
Sample configuration to install SQL Server using MSAs for Services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SQLSvcMSA = 'DOMAIN\MSASQLName$' | |
$AgtSvcMSA = 'DOMAIN\MSAAgentName$' | |
# These are required but not used since we are using MSAs | |
$SQLSvcAccount = New-Object System.Management.Automation.PSCredential($SQLSvcMSA, $('mypassword' | ConvertTo-SecureString -asPlainText -Force)) | |
$AgtSvcAccount = New-Object System.Management.Automation.PSCredential($AgtSvcMSA, $('mypassword' | ConvertTo-SecureString -asPlainText -Force)) | |
Configuration ServerBuild { | |
Import-DscResource -ModuleName 'PSDscResources' | |
Import-DscResource -ModuleName 'SqlServerDsc' | |
SqlSetup Install_SQL | |
{ | |
SourcePath = '\\fileshare\SQL2017\developer\' | |
UpdateEnabled = $true | |
UpdateSource = '\\fileshare\SQL2017\Updates\' | |
InstanceName = 'MSSQLSERVER' | |
Features = 'SQLEngine' | |
SQLSvcAccount = $SQLSvcAccount | |
AgtSvcAccount = $AgtSvcAccount | |
SQLSysAdminAccounts = 'DOMAIN\SysAdminAccount' | |
InstallSQLDataDir = 'D:\' | |
SQLUserDBDir = 'D:\SQLData' | |
SQLUserDBLogDir = 'D:\DbLogs' | |
SQLTempDBDir = 'D:\SQLData' | |
SQLTempDBLogDir = 'D:\DbLogs' | |
SecurityMode = 'SQL' | |
SAPwd = $SAPwd | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment