You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
When applying an xComputer resource that requires the computer to be renamed and join a domain concurrently, the following error is thrown: The directory service is busy.
Verbose logs showing the problem
VERBOSE: [EC2AMAZ-L43BSB0]: LCM: [ Start Resource ] [[Computer]ComputerName]
VERBOSE: [EC2AMAZ-L43BSB0]: LCM: [ Start Test ] [[Computer]ComputerName]
VERBOSE: [EC2AMAZ-L43BSB0]: [[Computer]ComputerName] Testing computer state for 'CS02-EUW1'.
VERBOSE: [EC2AMAZ-L43BSB0]: LCM: [ End Test ] [[Computer]ComputerName] in 0.0160 seconds.
VERBOSE: [EC2AMAZ-L43BSB0]: LCM: [ Start Set ] [[Computer]ComputerName]
VERBOSE: [EC2AMAZ-L43BSB0]: [[Computer]ComputerName] Setting computer state for 'CS02-EUW1'.
VERBOSE: [EC2AMAZ-L43BSB0]: [[Computer]ComputerName] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\cimv2,'className' = Win32_ComputerSystem'.
VERBOSE: [EC2AMAZ-L43BSB0]: [[Computer]ComputerName] Operation 'Enumerate CimInstances' complete.
>> TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Computer 'EC2AMAZ-L43BSB0' was successfully joined to the new domain 'contoso.com', but renaming it to 'CS02-EUW1' failed with the following error message: The directory service is busy."
>> TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Computer 'EC2AMAZ-L43BSB0' was successfully joined to the new domain 'contoso.com', but renaming it to 'CS02-EUW1' failed with the following error message: The directory service is busy."
>> TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Computer 'EC2AMAZ-L43BSB0' was successfully joined to the new domain 'contoso.com', but renaming it to 'CS02-EUW1' failed with the following error message: The directory service is busy."
>> TerminatingError(): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Computer 'EC2AMAZ-L43BSB0' was successfully joined to the new domain 'contoso.com', but renaming it to 'CS02-EUW1' failed with the following error message: The directory service is busy."
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Computer 'EC2AMAZ-L43BSB0' was successfully joined to the new domain 'contoso.com', but renaming it to 'CS02-EUW1' failed with the following error message: The directory service is busy.
Computer 'EC2AMAZ-L43BSB0' was successfully joined to the new domain
'contoso.com', but renaming it to 'CS02-EUW1' failed with the following
error message: The directory service is busy.
Suggested solution to the issue
This is a problem with the Add-Computer cmdlet that is being used by the resource. The following stand-alone code reproduces the error:
$addComputerParameters=@{
DomainName='contoso.com'Credential=Get-CredentialForce=$trueOUPath='ou=Servers,dc=contoso,dc=com'NewName='CS02-EUW1'
}
Add-Computer@addComputerParametersAdd-Computer : Computer 'TEST02' was successfully joined to the new domain 'contoso.com', but renaming it to 'CS02-EUW1' failed with the following error message: The directory service is busy.
At line:1 char:1+Add-Computer@addComputerParameters+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (TEST02:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : FailToRenameAfterJoinDomain,Microsoft.PowerShell.Commands.AddComputerCommand
Whereas the same code but without the OUPath parameter works successfully each time:
The DSC configuration that is used to reproduce the issue (as detailed as possible)
ConfigurationDomainNameDsc {
<#.DESCRIPTION The DomainNameDsc sets the computer name and joins the computer to the specified domain#>param (
# Specifies the Computer Name
[Parameter(Mandatory)]
[String]$ComputerName,# Specifies the Domain Name
[Parameter(Mandatory)]
[String]$DomainName,# Specifies the Domain Join Credentials
[Parameter(Mandatory)]
[PSCredential]$Credential,# Specifies the distinguished name of the organizational unit that the computer account will be created in
[Parameter(Mandatory)]
[String]$OU
)
Import-DscResource-ModuleName xActiveDirectory # https://github.com/PowerShell/xActiveDirectoryImport-DscResource-Module ComputerManagementDsc # https://github.com/PowerShell/ComputerManagementDsc
Node $AllNodes.NodeName {
Computer ComputerName {
Name =$ComputerName
DomainName =$DomainName
JoinOU =$OU
Credential =$Credential
DependsOn ='[xWaitForADDomain]WaitForADDomain'
}
}
}
The operating system the target node is running
OsName : Microsoft Windows Server 2016 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.2969.amd64fre.rs1_release.190503-1820
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 6.4.0.0 ComputerManagementDsc
The text was updated successfully, but these errors were encountered:
X-Guardian
changed the title
xComputer: Error When Joining a Domain and Renaming a Computer when a JoinOU is specified
xComputer: Error When Joining a Domain and Renaming a Computer when JoinOU is specified
Jun 6, 2019
Details of the scenario you tried and the problem that is occurring
When applying an
xComputer
resource that requires the computer to be renamed and join a domain concurrently, the following error is thrown:The directory service is busy
.Verbose logs showing the problem
Suggested solution to the issue
This is a problem with the
Add-Computer
cmdlet that is being used by the resource. The following stand-alone code reproduces the error:Whereas the same code but without the
OUPath
parameter works successfully each time:Suggested workaround for this issue
Trap for this error when calling Add-Computer, and then perform a Rename-Computer if it has occured. Sample code:
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
The text was updated successfully, but these errors were encountered: