From bbecdbc042c6ab6cd158abd8302dca308cf39153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20S=C3=A1nchez=20F=C3=A1bregas?= Date: Wed, 22 Aug 2018 12:45:31 +0200 Subject: [PATCH] Module win_domain_computer fix delete computer with child --- lib/ansible/modules/windows/win_domain_computer.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 {