dsccommunity / ActiveDirectoryDsc

This module contains DSC resources for deployment and configuration of Active Directory Domain Services.
MIT License
341 stars 141 forks source link

ADDomain: Add ability to specify DomainType to support TreeDomain use cases #689

Closed rhys96 closed 8 months ago

rhys96 commented 2 years ago

Problem description

To support use cases where a regional domain acts as a forest root domain (see Selecting the Forest Root Domain for more information) we need the ability to specify the DomainType separately.

Verbose logs

N/A

DSC configuration

N/A

Suggested solution

We need the ability to specify the DomainType, for example:

Configuration ADDomain_NewTreeDomain_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 'child'
        {
            DomainName                    = 'branch.contoso.com'
            Credential                    = $Credential
            SafemodeAdministratorPassword = $SafeModePassword
            DomainMode                    = 'WinThreshold'
            ParentDomainName              = 'hq.contoso.com'
            DomainType                    = 'TreeDomain'
        }
    }
}

Operating system the target node is running

N/A

PowerShell version and build the target node is running

N/A

ActiveDirectoryDsc version

N/A
johlju commented 2 years ago

Tagged it so that someone in the community can run with it. Looking forward to review a PR for this.

johlju commented 2 years ago

More information in #692.