-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DomainMode and ForestMode implemented (#199)
- xADDomain is now capable of setting the forest and domain functional level (issue #187).
- Loading branch information
Showing
19 changed files
with
3,838 additions
and
3,320 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<# | ||
.EXAMPLE | ||
This example will create a new domain with a new forest and a forest functional level of Server 2016 | ||
#> | ||
$ConfigurationData = @{ | ||
AllNodes = @( | ||
@{ | ||
NodeName = 'localhost' | ||
FFL = 'WinThreshold' | ||
DomainName = 'contoso.com' | ||
|
||
<# | ||
NOTE! THIS IS NOT RECOMMENDED IN PRODUCTION. | ||
This is added so that AppVeyor automatic tests can pass, otherwise | ||
the tests will fail on passwords being in plain text and not being | ||
encrypted. Because it is not possible to have a certificate in | ||
AppVeyor to encrypt the passwords we need to add the parameter | ||
'PSDscAllowPlainTextPassword'. | ||
NOTE! THIS IS NOT RECOMMENDED IN PRODUCTION. | ||
#> | ||
PSDscAllowPlainTextPassword = $true | ||
} | ||
) | ||
} | ||
|
||
configuration Example | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$DomainAdministratorCredential | ||
) | ||
|
||
Import-DscResource -ModuleName PSDscResources | ||
Import-DscResource -ModuleName xActiveDirectory | ||
node $AllNodes.NodeName | ||
{ | ||
WindowsFeature ADDS | ||
{ | ||
Name = 'AD-Domain-Services' | ||
Ensure = 'Present' | ||
} | ||
|
||
WindowsFeature RSAT | ||
{ | ||
Name = 'RSAT-AD-PowerShell' | ||
Ensure = 'Present' | ||
} | ||
|
||
xADDomain $Node.DomainName | ||
{ | ||
DomainName = $Node.DomainName | ||
DomainAdministratorCredential = $DomainAdministratorCredential | ||
SafemodeAdministratorPassword = $DomainAdministratorCredential | ||
ForestMode = $Node.FFL | ||
} | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<# | ||
.EXAMPLE | ||
This example will create a new child domain in an existing forest with a Domain Functional Level of Windows Server 2012R2 | ||
#> | ||
$ConfigurationData = @{ | ||
AllNodes = @( | ||
@{ | ||
NodeName = 'localhost' | ||
DFL = 'Win2012R2' | ||
DomainName = 'child' | ||
ParentDomain = 'contoso.com' | ||
|
||
<# | ||
NOTE! THIS IS NOT RECOMMENDED IN PRODUCTION. | ||
This is added so that AppVeyor automatic tests can pass, otherwise | ||
the tests will fail on passwords being in plain text and not being | ||
encrypted. Because it is not possible to have a certificate in | ||
AppVeyor to encrypt the passwords we need to add the parameter | ||
'PSDscAllowPlainTextPassword'. | ||
NOTE! THIS IS NOT RECOMMENDED IN PRODUCTION. | ||
#> | ||
PSDscAllowPlainTextPassword = $true | ||
} | ||
) | ||
} | ||
|
||
configuration Example | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$DomainAdministratorCredential | ||
) | ||
|
||
Import-DscResource -ModuleName PSDscResources | ||
Import-DscResource -ModuleName xActiveDirectory | ||
node $AllNodes.NodeName | ||
{ | ||
WindowsFeature ADDS | ||
{ | ||
Name = 'AD-Domain-Services' | ||
Ensure = 'Present' | ||
} | ||
|
||
WindowsFeature RSAT | ||
{ | ||
Name = 'RSAT-AD-PowerShell' | ||
Ensure = 'Present' | ||
} | ||
|
||
xADDomain $Node.DomainName | ||
{ | ||
DomainName = $Node.DomainName | ||
DomainAdministratorCredential = $DomainAdministratorCredential | ||
SafemodeAdministratorPassword = $DomainAdministratorCredential | ||
DomainMode = $Node.DFL | ||
ParentDomainName = $node.ParentDomain | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.