Window update script

Is it possible to write a script / powershell for my Window 2008 / 2012 servers to trigger the Window Update and reboot it automatically ?

Tks
AXISHKAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Amish SanghrajkaCommented:
Hi AXISHK,

If you are running an AD Domain you can configure updates to automatically download and install on a schedule using Group Policy.

- Open Group Policy
- Create a new policy and link it to an OU
- If your servers are not in a single OU  create a security group and add your servers to it
- Change the security filtering on the GPO to apply only to the security group you created
- Edit the GPO
- Go to Computer Configuration -> Administrative Templates -> Windows Components -> Windows Update
- Edit Configure Automatic Updates
- Select Enabled
- In Options select Option 4 under the Configure automatic updating
- Set your Scheduled install day and time

Kind regards,

Amish.
AXISHKAuthor Commented:
Actually, the patches has been downloaded but we need to schedule a day each month to install it (which is manually right now).

That's why I'm looking for a script to further automate it, Tks
Amish SanghrajkaCommented:
I'm afraid I can't help with the scripting side but this link may be of use:
https://gist.github.com/jacobludriks/9ca9ce61de251a5476f1

With regards to the GPO, you can force the installation at the specified time of whichever day of the week you want updates to be installed. This will not just download them but will install them and reboot the computer if required.
Rakesh KapoorCommented:
I'd not recommend to use the script to deploy patches. As you might need to select the patches that you want to deploy in production environment. In addition to that you might need to test these patches in test environment before rolling out in production.

You can check the steps given in the video to deploy patches.

https://www.youtube.com/watch?v=7FAVOEFBE5o
https://www.youtube.com/watch?v=qG_Mrb-CHvc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.