DSC resources for for configuration of a Windows computer. These DSC resources allow you to perform computer management tasks, such as renaming the computer, joining a domain and scheduling tasks as well as configuring items such as virtual memory, event logs, time zones and power settings.
The constructor for 'System.DirectoryServices.DirectoryEntry' in Delete-ADSIObject is using the wrong variable.
It is using $DomainName as the first argument instead of $Path
Verbose logs
This causes the machine to be added to the domain but the rename fails when there is an existing computer object in AD.
When running the code for Delete-ADSIObject directly DeleteTree() returns an unspecified error has occurred.
DSC configuration
# 'ComputerName' must exist in 'DomainName' for this problem to occur
Computer 'NameAndDomain'
{
Name = 'ComputerName'
DomainName = 'DomainName'
Credential = $Credential
}
Problem description
The constructor for 'System.DirectoryServices.DirectoryEntry' in Delete-ADSIObject is using the wrong variable. It is using $DomainName as the first argument instead of $Path
Verbose logs
DSC configuration
Suggested solution
Replace $DomainName with $Path
Operating system the target node is running
PowerShell version and build the target node is running
ComputerManagementDsc version