# windows patching\_uninstall

**URL:** <https://forum.ansible.com/t/windows-patching-uninstall/30395>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 22, 2019, 10:36am UTC](https://forum.ansible.com/t/windows-patching-uninstall/30395 "2019-05-22T10:36:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Vandyy\_Vines](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@The\_Vandyy\_Vines](https://forum.ansible.com/u/The_Vandyy_Vines)\
**Post date:** [May 22, 2019, 10:36am UTC](https://forum.ansible.com/t/windows-patching-uninstall/30395/1 "2019-05-22T10:36:17Z")

</div>

Hello All!

I need to uninstall the windows install package with KB article with help of ansible.  
the win\_update is not happy with ‘absent’

Please help.

Thanks

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [May 22, 2019, 4:30pm UTC](https://forum.ansible.com/t/windows-patching-uninstall/30395/2 "2019-05-22T16:30:41Z")

</div>

Hmm, I have not had to do this myself. One thing you could try is using wusa, although I think you may well have to use ‘become’ on your task as I believe wusa won’t run in a ‘normal’ ansible remote login

```auto
- name: uninstall KB1234
  win_shell: wusa /uninstall /kb:1234
  become: yes

```

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![The\_Vandyy\_Vines](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@The\_Vandyy\_Vines](https://forum.ansible.com/u/The_Vandyy_Vines)\
**Post date:** [May 23, 2019, 6:28am UTC](https://forum.ansible.com/t/windows-patching-uninstall/30395/3 "2019-05-23T06:28:34Z")

</div>

Hello Jon,

Thanks.  
I worked but to restart the os after uninstall , i am using this :

- name: uninstall kb  
win\_shell: WUSA /uninstall /kb:{{ kbno }} /quiet /norestart  
register: uninstall

- debug: var=“uninstall”

- win\_reboot:  
when: uninstall.rc == 0  
reboot\_timeout: 1500  
post\_reboot\_delay: 100

if the uninstall is successful.

Since without " /quiet /norestart " the job was getting stuck as it needed user input to whether restart or not at windows server side.

Is there any better way to handle the user input to restart if required in playbook.

Thanks!

---

<div class="post-metadata">

**Author:** ![lloyd\_noble](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@lloyd\_noble](https://forum.ansible.com/u/lloyd_noble)\
**Post date:** [July 28, 2022, 6:05am UTC](https://forum.ansible.com/t/windows-patching-uninstall/30395/4 "2022-07-28T06:05:13Z")

</div>

I am struggling with a proper way to remove a patch KB your method is failing for me
