diff --git a/lib/ansible/modules/windows/win_domain_computer.ps1 b/lib/ansible/modules/windows/win_domain_computer.ps1 index 14e944c0441..86c0d3f3007 100644 --- a/lib/ansible/modules/windows/win_domain_computer.ps1 +++ b/lib/ansible/modules/windows/win_domain_computer.ps1 @@ -129,8 +129,9 @@ Function Add-ConstructedState($desired_state) { # ------------------------------------------------------------------------------ Function Remove-ConstructedState($initial_state) { Try { - Remove-ADComputer ` - -Identity $initial_state.name ` + Get-ADComputer $initial_state.name ` + | Remove-ADObject ` + -Recursive ` -Confirm:$False ` -WhatIf:$check_mode } Catch {