Skip to content

Computer: AD object deletion before domain join issue #457

@webalexeu

Description

@webalexeu

Problem description

When using computer resource to perform domain join, currently there is a check in Active Directory to verify if computer object exist and deleting it prior to domain join
It is sometimes causing issue, even if the domain join was marked as successfull, the computer object has been deleted and computer is unjoined (with the need to restore object from recycle bin)
Moreover, it is causing issue if computer management object is managed within another stack (ex: terraform)
It is also requiring to grant delete computer object permissions

Verbose logs

No logs as it is a side effect of dsc

DSC configuration

Node localhost
    {
        Computer JoinDomain
        {
            Name       = 'server1'
            DomainName = 'contoso.com'
            Credential = MASKED
        }
    }

Suggested solution

I will propose a PR with a write attribute to give the choice to manage or not computer object within this module

Operating system the target node is running

OsName               : Microsoft Windows Server 2025 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 26100.1.amd64fre.ge_release.240331-1435
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.26100.4768
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.4768
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

ComputerManagementDsc version

9.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions