# Use Ansible to pull report of Installed, Failed, and Needed Windows Updates from WSUS

**URL:** <https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425>\
**Category:** Get Help\
**Tags:** windows\
**Created:** [September 4, 2025, 9:18pm UTC](https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425 "2025-09-04T21:18:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkovach](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@lkovach](https://forum.ansible.com/u/lkovach)\
**Post date:** [September 4, 2025, 9:18pm UTC](https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425/1 "2025-09-04T21:18:50Z")

</div>

Hey all! I am new to Ansible and apologize in advance if this topic has been discussed previously, I was not able to find anything about it. I am currently utilizing Ansible to install Windows updates and reboot the hosts, that’s all working fine. The next issue I want to tackle is reporting on Windows updates from the WSUS servers to see what updates have succeeded, failed, or are still needed. I have found a million ways to fail at this. My current playbook looks like this:

 ![image_2025-09-04_165925659](https://us1.discourse-cdn.com/ansible/original/2X/6/699b73c2d3cf75b989e27c262254a67b97d9dd3e.png)

And when I run the playbook with -vvv, I get this output:

 ![Screenshot 2025-09-04 164544](https://us1.discourse-cdn.com/ansible/original/2X/1/1cd5a0ce05822fc28db2fcd613f8274f98371fdd.jpeg)

We’re looking to deploy this in the near future, so I would really love to get this working quickly. Any help is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![anon81884396](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon81884396](https://forum.ansible.com/u/anon81884396)\
**Post date:** [September 4, 2025, 10:29pm UTC](https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425/2 "2025-09-04T22:29:11Z")

</div>

The error output is saying the flag of “-Update” is ambiguous. I don’t write Powershell so I don’t know what you’re meant to be doing or how you’ll be doing it.

Looking at [Get-WsusUpdate (UpdateServices) | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/updateservices/get-wsusupdate?view=windowsserver2025-ps) the switches for Get-WsusUpdate include `-UpdateId` and `-UpdateServer` but no `-Update`. If AI assisted you in creating the Powershell script, it may have hallucinated this part.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [September 5, 2025, 2:05am UTC](https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425/3 "2025-09-05T02:05:29Z")

</div>

Yep, PowerShell tries to select the correct parameter if you do a partial match but in this case there is both `-UpdateId` or `-UpdateServer` and `-Update` can be resolved to either so it fails. Another problem is `$ct.FullDomainName`, you haven’t defined `$ct` here, not sure if that’s meant to be `$_.FullDomainName` or something else.

Just as an FYI I recommend adding `$ErrorActionPreference = 'Stop'` to the top of your script so that when such errors occur it’ll stop and fail the task.

---

<div class="post-metadata">

**Author:** ![lkovach](https://avatars.discourse-cdn.com/v4/letter/l/e5b9ba/32.png) [@lkovach](https://forum.ansible.com/u/lkovach)\
**Post date:** [September 18, 2025, 4:43pm UTC](https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425/4 "2025-09-18T16:43:16Z")

</div>

I was able to work through this step by step and figured it out. Thanks for your suggestions!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 18, 2025, 4:43pm UTC](https://forum.ansible.com/t/use-ansible-to-pull-report-of-installed-failed-and-needed-windows-updates-from-wsus/44425/5 "2025-10-18T16:43:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
