-
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.
ADDomain: Add DomainType support (#705)
- ADDomain - Added support for creating a Tree domain via the DomainType field (issue #689, issue #692).
- Loading branch information
Showing
7 changed files
with
169 additions
and
3 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
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
67 changes: 67 additions & 0 deletions
67
source/Examples/Resources/ADDomain/3-ADDomain_NewDomainTree_Config.ps1
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,67 @@ | ||
<#PSScriptInfo | ||
.VERSION 1.0.1 | ||
.GUID 77c6a983-7bb0-4457-88e2-3e4f36727748 | ||
.AUTHOR DSC Community | ||
.COMPANYNAME DSC Community | ||
.COPYRIGHT DSC Community contributors. All rights reserved. | ||
.TAGS DSCConfiguration | ||
.LICENSEURI https://github.com/dsccommunity/ActiveDirectoryDsc/blob/main/LICENSE | ||
.PROJECTURI https://github.com/dsccommunity/ActiveDirectoryDsc | ||
.ICONURI https://dsccommunity.org/images/DSC_Logo_300p.png | ||
.RELEASENOTES | ||
Updated author, copyright notice, and URLs. | ||
#> | ||
|
||
#Requires -Module ActiveDirectoryDsc | ||
|
||
<# | ||
.DESCRIPTION | ||
This configuration will create a new domain tree in an existing forest with | ||
a Domain Functional Level of Windows Server 2016 (WinThreshold). | ||
The credential parameter must contain the domain qualified credentials of a | ||
user in the forest who has permissions to create a new domain tree. | ||
#> | ||
Configuration ADDomain_NewDomainTree_Config | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$Credential, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSCredential] | ||
$SafeModePassword | ||
) | ||
|
||
Import-DscResource -ModuleName PSDesiredStateConfiguration | ||
Import-DscResource -ModuleName ActiveDirectoryDsc | ||
|
||
node 'localhost' | ||
{ | ||
WindowsFeature 'ADDS' | ||
{ | ||
Name = 'AD-Domain-Services' | ||
Ensure = 'Present' | ||
} | ||
|
||
WindowsFeature 'RSAT' | ||
{ | ||
Name = 'RSAT-AD-PowerShell' | ||
Ensure = 'Present' | ||
} | ||
|
||
ADDomain 'fabrikam.com' | ||
{ | ||
DomainName = 'fabrikam.com' | ||
Credential = $Credential | ||
SafemodeAdministratorPassword = $SafeModePassword | ||
DomainType = 'TreeDomain' | ||
DomainMode = 'WinThreshold' | ||
ParentDomainName = 'contoso.com' | ||
} | ||
} | ||
} |
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