Skip to content

Commit

Permalink
Updated sql doc stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
adbertram committed May 25, 2017
1 parent 1ee54b3 commit 5df11d2
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions DSC/SQLServer/SQLServerStandalone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@
Configuration SQLStandalone
{
param(
[pscredential]$SetupCredential ## Need to pass a credential for setup
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[pscredential]$SetupCredential,

[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('sxs$')]
[string]$WindowsServerSource,

[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$SqlServerInstallSource,

[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$SysAdminAccount
)
## Download the xSQLServer module from the PowerShell Gallery
Import-DscResource -Module xSQLServer
Expand All @@ -16,26 +31,26 @@ Configuration SQLStandalone
{
Ensure = "Present"
Name = "NET-Framework-Core"
Source = "\MEMBERSRV1InstallersWindowsServer2012R2sourcessxs"
Source = $WindowsServerSource
}

## Have DSC grab install bits from the SourcePath, install under the instance name with the features
## using the specified SQL Sys admin accounts. Be sure to install the Windows feature first.
xSqlServerSetup 'SqlServerSetup'
{
DependsOn = "[WindowsFeature]NET-Framework-Core"
SourcePath = '\MEMBERSRV1InstallersSqlServer2016'
SourcePath = $SqlServerInstallSource
SetupCredential = $SetupCredential
InstanceName = 'MSSQLSERVER'
Features = 'SQLENGINE,FULLTEXT,RS,AS,IS'
SQLSysAdminAccounts = 'mylab.localAdministrator'
SQLSysAdminAccounts = $SysAdminAccount
}

## Add firewall exceptions for SQL Server but run SQL server setup first.
xSqlServerFirewall 'SqlFirewall'
{
DependsOn = '[xSqlServerSetup]SqlServerSetup'
SourcePath = '\MEMBERSRV1InstallersSqlServer2016'
SourcePath = $SqlServerInstallSource
InstanceName = 'MSSQLSERVER'
Features = 'SQLENGINE,FULLTEXT,RS,AS,IS'
}
Expand All @@ -46,5 +61,5 @@ if (-not (Get-Module -Name xSqlServer -ListAvailable)) {
Install-Module -Name 'xSqlServer' -Confirm:$false
}

SQLStandAlone
SQLStandAlone -SetupCredential (Get-Credential) -WindowServerSource '' -SqlServerInstallSource '' -SysAdminAccount '' -ConfigurationData '.\ConfiguraitonData.psd1'
Start-DscConfiguration –Wait –Force –Path '.\SQLStandalone' –Verbose

0 comments on commit 5df11d2

Please sign in to comment.