dsccommunity / dsccommunity/ComputerManagementDsc

Computer: AD object deletion before domain join issue

Open
#457 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
338
Forks
80
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Computer resource's domain-join handling and the check that deletes an existing Active Directory computer object. Review the DSC configuration shown and determine how the proposed write attribute should let users choose whether that object is managed. Done means domain joining no longer deletes an externally managed object and no delete permission is required when management is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.