Did you try to search for a script first before you came here? Questions like this have been asked a lot of times before and have been answered a lot of time before.
Regardless of that - instead of a potentially quirky and error prone beginner script you should urgnetly consider using WSUS. It is free of charge and it is made for managing updates for Windows clients and server.
I did already search for a potential script but couldn’t really find anything useful.
Most of the results were based on WSUS indeed.
However, I didn’t want to simply copy a script because otherwise, my colleagues would probably notice this because it would be too advanced for a known beginner like me, hence why I hestiated to do this.
Whenever I tried to install WSUS for Powershell, I’d receive an error saying that it wasn’t recognized as a proper cmd.
If this is a homework assignment or something like this you should discuss the task with your tutor/mentor/teacher. To replace a sophisticated, robust and industry wide common solution with a beginner script is actually a bad idea.
If you have code giving you errors you should post this code here along with the error messages and we can try to help you.
Please always format code, error messages, cosnole output or sample data as code using the preformatted text button ( </> ).
Ich habe nie behauptet, dass das Skript WSUS ersetzen soll, selbst beim Installieren davon taucht dieser Fehler auf. Vor allem geht es darum, dass man einen Lerneffekt mit drin hat. Soweit ich das verstehe, muss man bei WSUS gar nicht viel selbst machen. ^^
Es sollen lediglich Updates automatisiert laufen, was wiederum zur Verbesserung führt → Verbesserung des Unternehmens.
Es zu übersetzen wäre langwierig gewesen und konnte ja nicht wissen, dass hier auch deutschsprachige Personen sind, wenn alles in Englisch verfasst ist. ^^
Es bleibt aber trotzdem immernoch ein englisches Forum und deswegen machen wir auch bitte in Englisch weiter.
I’m not experienced with WSUS - we use SCCM to deploy updates - but I think you have a misconception about the WSUS PowerShell module. As far as I understood comes the module together with the installation of the WSUS server. The cmdlets are not meant to be used on clients. They are designed to manage the server.
You may find other modules in the PowerShellGallery they do what you want. But I’d recommend to use the built in mechanisms to deploy and install updates on clients. I’d expect these to be more robust and reliable than a script.
It looks like we are talking past each other or I’m simply bad at expressing myself.
I can see why you think that WSUS is the solution, however, keep in mind that the script I would write will be checked thoroughly before going into action. Like I said: the task is to write a script and learn powershell and not use already configured clients / server to do the job for me.
OK, but as I already said I think you’re using the wrong tool. The cmdlets you try to use - according to the error messages you posted - are usually not available on clients. They are meant to be used to manage the WSUS server.
That’s why I recommended to search the PowerShellGallery for a module offering the functionality you need.
But maybe I’m wrong. You should post the command you used to install the WSUS module and the error messages you get.
WSUS is a feature and with this command you would install it ON A SERVER!
I don’t know what to answer you: This has nothing to do with your initial question.
If you want to get help you should ask a specific question about a particular piece of code you wrote and you have issues with. In this case you should post this piece of code here (fomratted as code) along with the error messages you might get (formatted as code) and/or a description what is or how is it not working as expected.