Adding to Theo Ekelmans's comment, I did do a little snooping to see how this could work and found this powershell module:
This would be using a different methodology for this than the original script. The original script was going out to the web and getting a list of the latest CU's and SP's for SQL Server and comparing those results to what you currently have installed. Using the above script, you would be looking at the local machines that you manage and generating a list of missing updates to install.
you'd install then import that module then run "get-WUlist -WindowsUpdate -ComputerName <computer name>" (which on my system was a slow process to run) and that'll tell you all of the OS patches missing on the system it was run against. If you replace "WindowsUpdate" with "MicrosoftUpdate" it will include all microsoft products such as office and SQL.
So, you'd need to run that powershell against all computers in your domain that you manage.
Downside to it is that it will return some driver update recommendataions that you may or may not want to install. But having that loop through a list of computers from a text file (or AD) shouldn't be too tricky to code up. Then take the result of that and store it in a table in SQL and you can query which machines are missing which updates pretty easily. Not sure how many computers you need to watch this on, but if the list is large, you may want to break it up into multiple lists and have multiple jobs manage it running at different times.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.