Solved

Create a script to automate installing the updates and then restarting of your server.

Posted on 2009-05-12
18
867 Views
Last Modified: 2012-05-06
does anyone have this script automate installing the updates and then restarting  your server.?
I have seen links that talk about this script but never found it.
Thanks
0
Comment
Question by:jskfan
  • 6
  • 6
  • 6
18 Comments
 
LVL 19

Expert Comment

by:PeteJThomas
Comment Utility
Sorry, I need a little more information?

Are you referring to Automating the install of MS Updates through automatic updates? And configuring this for all the clients in your domain?

If so, this is configured through a group policy setting, there's no need for any scripts. Can you clarify if that is what you mean? If not, is there a particular reason you want to use a script?

Cheers!

Pete
0
 
LVL 19

Expert Comment

by:PeteJThomas
Comment Utility
Oh and to give you a little more, if you just want to configure auto updates for all your clients as above, then using the Group Policy Management Console, create a new policy, and navigate to:

Computer Configuration > Admin Templates > Windows Components > Windows Update

There are several settings you need to configure in there, the main one being the 'Configure Automatic Updates' setting, which allows you to specify the auto updates behaviour etc, and turns auto updates on for all the clients that this policy applies to.

Once that's created, you simply need to link the policy to a test OU, add a test computer account into that OU, then test it. :)

Pete
0
 

Author Comment

by:jskfan
Comment Utility
In WSUS Policy, there is an option: Autodownload and Notify for install.
After this is done and you want to install the updates, you will have to do it manually and restart the computers. there should be a script that you can run and will install the updates and restart the computers at your convenience.

I know that there is an option to download and schedule the install, but this will install updates and can reboot the computers after the updates are installed. maybe the reboot will happen during production time and you don't want this to happen.
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
I believe the script you are referring to can be found here:
 
http://www.vbshf.com/vbshf/forum/forums/thread-view.asp?tid=199&start=1
0
 

Author Comment

by:jskfan
Comment Utility
Can you pinpoint to the script on that link?
0
 
LVL 19

Expert Comment

by:PeteJThomas
Comment Utility
Ok, so are we referring specifically to servers or to users PC?

As there is also a setting to forcibly DISALLOW the auto restart of computers after an update, and instead, once the updates are installed, the user (if logged on) will be prompted by a message notifying them that a restart is required to complete updates installation, and ask them if they want to install now.

If they say no, then the PC will not restart, and they will be reminded again at an interval you specify (so every 2 hours for example).

However if we're talking about servers only, then obviously it's a different matter, as these are generally unattended so there'd be no one there to accept the restart request...

Can you clarify please?

Many thanks,

Pete
0
 

Author Comment

by:jskfan
Comment Utility
let's say in WSUS, you will see the updates that haven't been approved/installed for each computer.
It's saturday 11 pm, and I want the updates to be approved/installed and the computers rebooted if the updates require so.

It's almost similar to download and schedule install, let's say you selected the schedule on Sunday at 3 am, this option will start downloading the updates at 3 am on sunday and we don't know how long it takes, then it will start installing the updates and we don't know how long it takes, you might end up having your computers rebooting on Monday during the production time.

so it's better to have a script that install the updates/reboot if required, and it would be really perfect if it reports that some updates require a reboot and the specified computer has n't rebooted, this way I would rather reboot then let it reboot by itself during production time.


0
 
LVL 19

Accepted Solution

by:
PeteJThomas earned 250 total points
Comment Utility
Ah ok I see, so we're talking about just the servers then. :)

I guess this script would be a nice and easy way to 'manually' update these servers in that case.

Oh and I believe the script is in the thread shown in the screenshot below (at the bottom of the initial post) on dstewartjr's link.



script.JPG
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
That would be the correct spot Pete.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:jskfan
Comment Utility
Cool...
Now where do I need to put the script? is it on the WSUS server?
Do I need to modify anything in the script to match my domain? if so what is needed to be changed.?
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
The original link explains what to change and how to use
0
 

Author Comment

by:jskfan
Comment Utility
I don't see on the link where it says copy the script to a certaing computer and double-click on it.
I have downloaded this:UpdateHF_v2.6-beta.txt (49KB - 5818 downloads)
now what's the next step?
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
you rename it with .VBS extension and edit the values below
 
sExePath - this is the location of the WindowsUpdateAgent30-x86.exe. Download it from http://go.microsoft.com/fwlink/?LinkId=43264
strMailFrom - arbitrary reply-to address
strMailto - email address you want the report to mail to (this is for manual mode - or if the command-line switch isn't specified).
strSMTPServer - the IP address of the email server you are sending the reports through.
 
0
 

Author Comment

by:jskfan
Comment Utility
is the script going to be run from the WSUS server or from my workstation will be fine.?
will this:
WindowsUpdateAgent20-x86.exe
be downloaded to a location in WSUS server?

0
 
LVL 47

Assisted Solution

by:dstewartjr
dstewartjr earned 250 total points
Comment Utility
run from anywhere,
 
WindowsUpdateAgent30-x86.exe  <<<(Notice updated version) You download this and modify the " sExePath "   to point to the location where you download it to.

 
0
 
LVL 19

Expert Comment

by:PeteJThomas
Comment Utility
Many thanks, though dstewartjr was more deserving here as he answered your actual original question. :)

I appreciate it though!

Hope it all works out for you,

Pete
0
 
LVL 47

Expert Comment

by:dstewartjr
Comment Utility
You need to learn to accept answers correctly, as PeteJThomas only provided a screenshot of where to click. I not only supplied the link, but walked you thru using the script.
0
 
LVL 19

Expert Comment

by:PeteJThomas
Comment Utility
dstewartjr is indeed correct - I have a little extra info on this as I've answered two of jskfan's followup questions, which both pertained to using policy instead of the script, so I think he/she went down that route instead, which may be where the confusion came in...

But the fact is, the answer to the question (where is the script?) was not answered by me in this case... :)

Sorry I'm not trying to sound ungrateful!

Good luck all,

Pete
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now