forked from dsccommunity/ComputerManagementDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-JoinDomain.ps1
More file actions
32 lines (29 loc) · 723 Bytes
/
2-JoinDomain.ps1
File metadata and controls
32 lines (29 loc) · 723 Bytes
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
<#
.EXAMPLE
This configuration sets the machine name to 'Server01' and
joins the 'Contoso' domain.
Note: this requires an AD credential to join the domain.
#>
Configuration Example
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[System.Management.Automation.PSCredential]
$Credential
)
Import-DscResource -Module xComputerManagement
Node $NodeName
{
xComputer JoinDomain
{
Name = 'Server01'
DomainName = 'Contoso'
Credential = $Credential # Credential to join to domain
}
}
}