Backport/2.6/44500 Module win_domain_computer fix delete computer with child (#44707)
* Module win_domain_computer fix delete computer with child (cherry picked from commit bbecdbc042c6ab6cd158abd8302dca308cf39153) * add changelog fragment (cherry picked from commit b6af40a1cc7a0796cdbe96ebfc78b2ad501c0fdb)
This commit is contained in:
parent
f7f6d47c7e
commit
67e880dd82
2 changed files with 5 additions and 2 deletions
2
changelogs/fragments/44500-win_domain_computer.yaml
Normal file
2
changelogs/fragments/44500-win_domain_computer.yaml
Normal 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)
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue