Module win_domain_computer fix delete computer with child (#44500)

* Module win_domain_computer fix delete computer with child

* add changelog fragment
This commit is contained in:
Daniel-Sanchez-Fabregas 2018-08-27 07:54:16 +02:00 committed by Jordan Borean
commit af49627a08
2 changed files with 5 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- win_domain_computer - fixed deletion of computer active directory object that have dependent objects (https://github.com/ansible/ansible/pull/44500)

View file

@ -129,8 +129,9 @@ Function Add-ConstructedState($desired_state) {
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
Function Remove-ConstructedState($initial_state) { Function Remove-ConstructedState($initial_state) {
Try { Try {
Remove-ADComputer ` Get-ADComputer $initial_state.name `
-Identity $initial_state.name ` | Remove-ADObject `
-Recursive `
-Confirm:$False ` -Confirm:$False `
-WhatIf:$check_mode -WhatIf:$check_mode
} Catch { } Catch {