Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Jul 29, 2019
1 parent 91fbb21 commit a465f69
Show file tree
Hide file tree
Showing 25 changed files with 95 additions and 235 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADComputer

.DESCRIPTION
Expand Down
116 changes: 35 additions & 81 deletions DSCResources/MSFT_ADDomain/en-US/about_ADDomain.help.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADDomain

.DESCRIPTION
Expand Down Expand Up @@ -77,7 +77,7 @@ Configuration ADDomain_NewForest_Config
Import-DscResource -ModuleName PSDscResources
Import-DscResource -ModuleName ActiveDirectoryDsc

node $AllNodes.NodeName
node 'localhost'
{
WindowsFeature 'ADDS'
{
Expand All @@ -91,26 +91,16 @@ Configuration ADDomain_NewForest_Config
Ensure = 'Present'
}

ADDomain $Node.DomainName
ADDomain 'contoso.com'
{
DomainName = $Node.DomainName
DomainName = 'contoso.com'
Credential = $Credential
SafemodeAdministratorPassword = $SafeModePassword
ForestMode = $Node.FFL
ForestMode = 'WinThreshold'
}
}
}

$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
FFL = 'WinThreshold'
DomainName = 'contoso.com'
}
)
}

.EXAMPLE 2

This configuration will create a new child domain in an existing forest with
Expand All @@ -134,7 +124,7 @@ Configuration ADDomain_NewChildDomain_Config
Import-DscResource -ModuleName PSDscResources
Import-DscResource -ModuleName ActiveDirectoryDsc

node $AllNodes.NodeName
node 'localhost'
{
WindowsFeature 'ADDS'
{
Expand All @@ -148,30 +138,21 @@ Configuration ADDomain_NewChildDomain_Config
Ensure = 'Present'
}

ADDomain $Node.DomainName
ADDomain 'child'
{
DomainName = $Node.DomainName
DomainName = 'child'
Credential = $Credential
SafemodeAdministratorPassword = $SafeModePassword
DomainMode = $Node.DFL
ParentDomainName = $node.ParentDomain
DomainMode = Win2012R2'
ParentDomainName = 'contoso.com'
}
}
}

$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
DFL = 'Win2012R2'
DomainName = 'child'
ParentDomain = 'contoso.com'
}
)
}

.EXAMPLE 3

This configuration will create a domain, and then create a child domain on
another node.

Configuration ADDomain_NewForestWithParentAndChildDomain_Config
{
Expand All @@ -198,7 +179,7 @@ Configuration ADDomain_NewForestWithParentAndChildDomain_Config

Import-DscResource -ModuleName ActiveDirectoryDsc

Node $AllNodes.Where{ $_.Role -eq 'Parent DC' }.NodeName
Node 'dsc-testParentNode1'
{
WindowsFeature 'ADDSInstall'
{
Expand All @@ -208,7 +189,7 @@ Configuration ADDomain_NewForestWithParentAndChildDomain_Config

ADDomain 'FirstDS'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
Credential = $Credential
SafeModeAdministratorPassword = $SafeModePassword
DnsDelegationCredential = $DnsDelegationCredential
Expand All @@ -218,17 +199,17 @@ Configuration ADDomain_NewForestWithParentAndChildDomain_Config

WaitForADDomain 'DscForestWait'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
DomainUserCredential = $Credential
RetryCount = $Node.RetryCount
RetryIntervalSec = $Node.RetryIntervalSec
RetryCount = 50
RetryIntervalSec = 30

DependsOn = '[ADDomain]FirstDS'
}

ADUser 'FirstUser'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
Credential = $Credential
UserName = 'dummy'
Password = $NewADUserPassword
Expand All @@ -239,7 +220,7 @@ Configuration ADDomain_NewForestWithParentAndChildDomain_Config

}

Node $AllNodes.Where{ $_.Role -eq 'Child DC' }.NodeName
Node 'dsc-testChildNode2'
{
WindowsFeature 'ADDSInstall'
{
Expand All @@ -249,18 +230,18 @@ Configuration ADDomain_NewForestWithParentAndChildDomain_Config

WaitForADDomain 'DscForestWait'
{
DomainName = $Node.ParentDomainName
DomainName = 'dsc-test.contoso.com'
DomainUserCredential = $Credential
RetryCount = $Node.RetryCount
RetryIntervalSec = $Node.RetryIntervalSec
RetryCount = 50
RetryIntervalSec = 30

DependsOn = '[WindowsFeature]ADDSInstall'
}

ADDomain 'ChildDS'
{
DomainName = $Node.DomainName
ParentDomainName = $Node.ParentDomainName
DomainName = 'dsc-child'
ParentDomainName = 'dsc-test.contoso.com'
Credential = $Credential
SafeModeAdministratorPassword = $SafeModePassword

Expand All @@ -271,33 +252,6 @@ Configuration ADDomain_NewForestWithParentAndChildDomain_Config

.EXAMPLE 4


# Configuration Data for AD
$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'dsc-testNode1'
Role = 'Primary DC'
DomainName = 'dsc-test.contoso.com'
CertificateFile = 'C:\publicKeys\targetNode.cer'
Thumbprint = 'AC23EA3A9E291A75757A556D0B71CBBF8C4F6FD8'
RetryCount = 20
RetryIntervalSec = 30
},
@{
NodeName = 'dsc-testNode2'
Role = 'Replica DC'
DomainName = 'dsc-test.contoso.com'
CertificateFile = 'C:\publicKeys\targetNode.cer'
Thumbprint = 'AC23EA3A9E291A75757A556D0B71CBBF8C4F6FD8'
RetryCount = 20
RetryIntervalSec = 30
}
)
}

.EXAMPLE 4

This configuration will create a highly available domain by adding
a second domain controller to the newly created domain.
The WaitForDomain resource is used to ensure that the domain is
Expand Down Expand Up @@ -328,7 +282,7 @@ Configuration ADDomain_NewDomainWithTwoDCs_Config

Import-DscResource -ModuleName ActiveDirectoryDsc

Node $AllNodes.Where{ $_.Role -eq 'Primary DC' }.NodeName
Node 'dsc-testDomainNode1'
{
WindowsFeature 'ADDSInstall'
{
Expand All @@ -338,7 +292,7 @@ Configuration ADDomain_NewDomainWithTwoDCs_Config

ADDomain 'FirstDS'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
Credential = $Credential
SafeModeAdministratorPassword = $SafeModePassword
DnsDelegationCredential = $DnsDelegationCredential
Expand All @@ -348,17 +302,17 @@ Configuration ADDomain_NewDomainWithTwoDCs_Config

WaitForADDomain 'DscForestWait'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
DomainUserCredential = $Credential
RetryCount = $Node.RetryCount
RetryIntervalSec = $Node.RetryIntervalSec
RetryCount = 20
RetryIntervalSec = 30

DependsOn = '[ADDomain]FirstDS'
}

ADUser 'FirstUser'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
Credential = $Credential
UserName = 'dummy'
Password = $NewADUserPassword
Expand All @@ -368,7 +322,7 @@ Configuration ADDomain_NewDomainWithTwoDCs_Config
}
}

Node $AllNodes.Where{ $_.Role -eq 'Replica DC' }.NodeName
Node 'dsc-testDomainNode2'
{
WindowsFeature 'ADDSInstall'
{
Expand All @@ -378,17 +332,17 @@ Configuration ADDomain_NewDomainWithTwoDCs_Config

WaitForADDomain 'DscForestWait'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
DomainUserCredential = $Credential
RetryCount = $Node.RetryCount
RetryIntervalSec = $Node.RetryIntervalSec
RetryCount = 20
RetryIntervalSec = 30

DependsOn = '[WindowsFeature]ADDSInstall'
}

ADDomainController 'SecondDC'
{
DomainName = $Node.DomainName
DomainName = 'dsc-test.contoso.com'
Credential = $Credential
SafeModeAdministratorPassword = $SafeModePassword

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADDomainController

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADDomainDefaultPasswordPolicy

.DESCRIPTION
Expand Down Expand Up @@ -65,15 +65,15 @@ Configuration ADDomainDefaultPasswordPolicy_ConfigureDefaultPasswordPolicy_Confi
{
Param
(
[parameter(Mandatory = $true)]
[Parameter(Mandatory = $true)]
[System.String]
$DomainName,

[parameter(Mandatory = $true)]
[Parameter(Mandatory = $true)]
[System.Boolean]
$ComplexityEnabled,

[parameter(Mandatory = $true)]
[Parameter(Mandatory = $true)]
[System.Int32]
$MinPasswordLength
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADDomainTrust

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADForestProperties

.DESCRIPTION
Expand Down Expand Up @@ -50,29 +50,17 @@ Configuration ADForestProperties_ReplaceForestProperties_Config
{
Import-DscResource -ModuleName ActiveDirectoryDsc

node $AllNodes.NodeName
node 'localhost'
{
ADForestProperties $Node.ForestName
{
ForestName = $Node.ForestName
UserPrincipalNameSuffix = $Node.UserPrincipalNameSuffix
ServicePrincipalNameSuffix = $Node.ServicePrincipalNameSuffix
}
}
}

$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'dc.contoso.com'
ForestName = 'contoso.com'
UserPrincipalNameSuffix = 'fabrikam.com', 'industry.com'
ServicePrincipalNameSuffix = 'corporate.com'
}
)
}
}


.EXAMPLE 2

This configuration will manage the Service and User Principal name suffixes in
Expand Down
2 changes: 1 addition & 1 deletion DSCResources/MSFT_ADGroup/en-US/about_ADGroup.help.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADGroup

.DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion DSCResources/MSFT_ADKDSKey/en-US/about_ADKDSKey.help.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADKDSKey

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADManagedServiceAccount

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADObjectEnabledState

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADObjectPermissionEntry

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADOrganizationalUnit

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADRecycleBin

.DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.NAME
.NAME
ADReplicationSite

.DESCRIPTION
Expand Down
Loading

0 comments on commit a465f69

Please sign in to comment.