# \[Windows\] Is there a way to install a single Windows Update by KB article ID?

**URL:** <https://forum.ansible.com/t/windows-is-there-a-way-to-install-a-single-windows-update-by-kb-article-id/22779>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 12, 2016, 6:15pm UTC](https://forum.ansible.com/t/windows-is-there-a-way-to-install-a-single-windows-update-by-kb-article-id/22779 "2016-10-12T18:15:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Jackson](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@Brian\_Jackson](https://forum.ansible.com/u/Brian_Jackson)\
**Post date:** [October 12, 2016, 6:15pm UTC](https://forum.ansible.com/t/windows-is-there-a-way-to-install-a-single-windows-update-by-kb-article-id/22779/1 "2016-10-12T18:15:41Z")

</div>

I don’t see this functionality in the `win_updates` module, but I wanted to ask. I have a prerequisite on Windows 7 to install KB2999226 and KB2842230. I’d prefer to not install every available update to preserve consistency, portability, reproducibility, etc. Is there an easy way to do this?

P.S. I need those KBs so Ansible itself can install/upgrade Chocolatey properly. I’ve installed them manually on a test box to verify they fix my Ansible/Chocolatey issues.

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [October 13, 2016, 3:34pm UTC](https://forum.ansible.com/t/windows-is-there-a-way-to-install-a-single-windows-update-by-kb-article-id/22779/2 "2016-10-13T15:34:50Z")

</div>

This functionality isn’t currently implemented on win\_updates. I’ve had a few people ask for it, and I might have time to implement it for 2.3, as it’s not terribly difficult so long as we stick to “limit the update search/install to these KBs” and not “force install exactly these KBs”.

Unfortunately I believe KB2842230 is a hotfix, and thus not available on Windows Update- we don’t yet have a supported method to install hotfixes under WinRM. wusa.exe is the only supported method, and it fails under WinRM (likely for the same reason that makes the win\_updates module so complex). If you have to touch the box anyway, you might do better to just upgrade to Powershell 4 or 5.

-Matt

---

<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:** [October 18, 2016, 1:13pm UTC](https://forum.ansible.com/t/windows-is-there-a-way-to-install-a-single-windows-update-by-kb-article-id/22779/3 "2016-10-18T13:13:38Z")

</div>

You can install hotfixes if necessary, although its a bit of a faff.

see [https://support.microsoft.com/en-us/kb/27738398](https://support.microsoft.com/en-us/kb/27738398)

You have to use wusa with /extract to unpack the update file (which does work over winrm) and then use dism.exe to install the cab.

Example below.

Hope this helps,

Jon

- name: check if Windows8.1-KB2999226-x64.msu hotfix has been applied  
raw: Get-Hotfix -Id KB2999226  
register: hotfix\_status  
ignore\_errors: true

- name: show hotfix status  
debug:  
var: hotfix\_status

# Unfortunately you can’t use wusa directly to install windows updates.

# see [https://support.microsoft.com/en-us/kb/2773898](https://support.microsoft.com/en-us/kb/2773898) for details

# you have to unpack the update file and then use dism.exe to install the cab

- name: unpack the hotfix if needed  
raw: ‘wusa C:\deployment\current\Windows8.1-KB2999226-x64.msu /extract:C:\deployment\archive’  
when: “hotfix\_status.rc == 1”

- name: use dism to install the cab containing the hotfix  
raw: ‘dism.exe /online /add-package /PackagePath:C:\deployment\archive\Windows8.1-KB2999226-x64.cab’  
when: “hotfix\_status.rc == 1”

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [October 18, 2016, 5:14pm UTC](https://forum.ansible.com/t/windows-is-there-a-way-to-install-a-single-windows-update-by-kb-article-id/22779/4 "2016-10-18T17:14:39Z")

</div>

Thanks Jon- that’s a great workaround!
