-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetupSQL.ps1
More file actions
48 lines (36 loc) · 1.21 KB
/
Copy pathSetupSQL.ps1
File metadata and controls
48 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
configuration LabSQL
{
param
(
[Parameter(Mandatory)]
[string]$MachineName,
[Parameter(Mandatory)]
[string]$Domain,
[Parameter(Mandatory)]
[pscredential]$DomainCredential
)
#Import the required DSC Resources
Import-DscResource -Module xComputerManagement
Node $AllNodes.Where{$_.Role -eq "SQL"}.Nodename
{
LocalConfigurationManager
{
RebootNodeIfNeeded = $true
ConfigurationMode = "ApplyOnly"
}
xComputer JoinDomain
{
Name = $MachineName
DomainName = $Domain
Credential = $DomainCredential # Credential to join to domain
}
}
}
$config = Invoke-Expression (Get-content $PSScriptRoot\LabConfig.psd1 -Raw)
LabSQL -configurationData $config `
-MachineName "ps-sql-01" `
-Domain "psdsc.waterstonslabs.com" `
-DomainCredential (Get-Credential -UserName "alex" `
-Message "Domain Admin Credential")
Set-DSCLocalConfigurationManager -Path .\LabSQL -Verbose
Start-DscConfiguration -ComputerName ps-sql-01 -Wait -Force -Verbose -path .\LabSQL -Debug