Skip to main content

5 Ways to Install Windows Updates on Windows Server 2008 R2 Core



One of the challenges of using Server Core is the management aspect. Luckily for us, most of the management pain has been solved by usage of the either manually created scripts, 3rd-party graphical user interface tools, and lately in R2 - the SCONFIG tool.

So after properly configuring Server Core and getting ready to deploy it on your server farm, you now want to download and install the latest Windows Server 2008 R2 updates from the Windows Update site. How do you do that?

Well, there are several methods which you can use to download and install the latest Windows Server 2008 R2 updates from the Windows Update site. Read on.
Method #1 - Manually Install Updates

In order to install updates you need to configure the Server Core machine to automatically download and install updates:

At a command prompt:
To verify the current setting, type:


cscript scregedit.wsf /AU /v


To enable automatic updates, type:


cscript scregedit.wsf /AU 4


To disable automatic updates, type:


cscript scregedit.wsf /AU 1

Problem with this setting is that you have no control over what updates are being downloaded and installed. Therefore, if you do not wish to enable auto updates, you can manually download each update from the Windows Update site, transfer them to the Core machine, and then manually installing them using msiexec.exe or wusa.exe:

Msiexec (command-line options)


Method #2 - Install from Script





Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()

WScript.Echo "Searching for updates..." & vbCRLF

Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software'")

WScript.Echo "List of applicable items on the machine:"

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
WScript.Echo I + 1 & "> " & update.Title
Next

If searchResult.Updates.Count = 0 Then
WScript.Echo "There are no applicable updates."
WScript.Quit
End If

WScript.Echo vbCRLF & "Creating collection of updates to download:"

Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")

For I = 0 to searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
WScript.Echo I + 1 & "> adding: " & update.Title
updatesToDownload.Add(update)
Next

WScript.Echo vbCRLF & "Downloading updates..."

Set downloader = updateSession.CreateUpdateDownloader()
downloader.Updates = updatesToDownload
downloader.Download()

WScript.Echo vbCRLF & "List of downloaded updates:"

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
If update.IsDownloaded Then
WScript.Echo I + 1 & "> " & update.Title
End If
Next

Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")

WScript.Echo vbCRLF & _
"Creating collection of downloaded updates to install:"

For I = 0 To searchResult.Updates.Count-1
set update = searchResult.Updates.Item(I)
If update.IsDownloaded = true Then
WScript.Echo I + 1 & "> adding: " & update.Title
updatesToInstall.Add(update)
End If
Next

WScript.Echo vbCRLF & "Would you like to install updates now? (Y/N)"
strInput = WScript.StdIn.Readline
WScript.Echo

If (strInput = "N" or strInput = "n") Then
WScript.Quit
ElseIf (strInput = "Y" or strInput = "y") Then
WScript.Echo "Installing updates..."
Set installer = updateSession.CreateUpdateInstaller()
installer.Updates = updatesToInstall
Set installationResult = installer.Install()

'Output results of install
WScript.Echo "Installation Result: " & _
installationResult.ResultCode
WScript.Echo "Reboot Required: " & _
installationResult.RebootRequired & vbCRLF
WScript.Echo "Listing of updates installed " & _
"and individual installation results:"

For I = 0 to updatesToInstall.Count - 1
WScript.Echo I + 1 & "> " & _
updatesToInstall.Item(i).Title & _
": " & installationResult.GetUpdateResult(i).ResultCode
Next
End If

Copy the text found in the script, save it as WUA_SearchDownloadInstall.vbs in the system32 folder, and run:


cscript WUA_SearchDownloadInstall.vbs

Very cool indeed.




Method #3 - Use SCONFIG

As noted on my "Manage Windows Server 2008 R2 Core with SCONFIG" article, SCONFIG is a very nice tool that is now built into R2, that you can use to manage many aspects of the Server Core machine. One of these features is the ability to control the Windows Updates settings, and then use it to download updates and either selectively install them, or install them all at once.

To run SCONFIG simply enter sconfig.cmd in the command prompt window, and press Enter.

First, enable Automatic Updates by typing "5" and pressing Enter.



Type "a" and press Enter.



Next, type "6" to get SCONFIG to search and download missing updates.



You'll be able to install all missing updates, or just the recommended ones.








Method #4 - Visual Core Configurator 2008

Visual Core Configurator 2008 is a nice GUI-based tool created by Guillermo Musumeci. The tool is free to use, and can be obtained here:




CtxAdmTools - Visual Core Configurator 2008 v1.1




After downloading the tool, either copy the files to the Server Core machine, or if it's a virtual machine, use the ISO file download instead.

Run the tool.



Press on the "Windows Update" icon.



Press on the "Search for updates" button.



Select the updates you want to download and install, and press on the "Download and Install Updates" button.


Method #5 - Install Using Core Configurator 2.0

On of the first 3rd-party GUI tools for Server Core, this tool is free to use, and can be obtained here:

Core Configurator 2.0 (Windows Server 2008 R2)

Run Start_Coreconfig.wsf to start the tool.



The latest version of Core Configurator needs .NET Framework and PowerShell, which it will automatically install once the tool is executed.



You will be prompted to join the customer Experience Improvement Program. Accept or decline.



Press the "Control Panel" button.



Press the "Windows Updates" button.



First, you can configure the Auto Updates settings.



Then, press on the "Check for updates" link and press the "Download updates" button.



You can now select which updates to install.



Also remember that there are other 3rd-party update management tools. Do you have feedback about other updating methods you're using? Please send them over by using the feedback page or by clicking on my profile link.

Popular posts from this blog

HOW TO EDIT THE BCD REGISTRY FILE

The BCD registry file controls which operating system installation starts and how long the boot manager waits before starting Windows. Basically, it’s like the Boot.ini file in earlier versions of Windows. If you need to edit it, the easiest way is to use the Startup And Recovery tool from within Vista. Just follow these steps: 1. Click Start. Right-click Computer, and then click Properties. 2. Click Advanced System Settings. 3. On the Advanced tab, under Startup and Recovery, click Settings. 4. Click the Default Operating System list, and edit other startup settings. Then, click OK. Same as Windows XP, right? But you’re probably not here because you couldn’t find that dialog box. You’re probably here because Windows Vista won’t start. In that case, you shouldn’t even worry about editing the BCD. Just run Startup Repair, and let the tool do what it’s supposed to. If you’re an advanced user, like an IT guy, you might want to edit the BCD file yourself. You can do this

DNS Scavenging.

                        DNS Scavenging is a great answer to a problem that has been nagging everyone since RFC 2136 came out way back in 1997.  Despite many clever methods of ensuring that clients and DHCP servers that perform dynamic updates clean up after themselves sometimes DNS can get messy.  Remember that old test server that you built two years ago that caught fire before it could be used?  Probably not.  DNS still remembers it though.  There are two big issues with DNS scavenging that seem to come up a lot: "I'm hitting this 'scavenge now' button like a snare drum and nothing is happening.  Why?" or "I woke up this morning, my DNS zones are nearly empty and Active Directory is sitting in a corner rocking back and forth crying.  What happened?" This post should help us figure out when the first issue will happen and completely avoid the second.  We'll go through how scavenging is setup then I'll give you my best practices.  Scavenging s

AD LDS – Syncronizing AD LDS with Active Directory

First, we will install the AD LDS Instance: 1. Create and AD LDS instance by clicking Start -> Administrative Tools -> Active Directory Lightweight Directory Services Setup Wizard. The Setup Wizard appears. 2. Click Next . The Setup Options dialog box appears. For the sake of this guide, a unique instance will be the primary focus. I will have a separate post regarding AD LDS replication at some point in the near future. 3. Select A unique instance . 4. Click Next and the Instance Name dialog box appears. The instance name will help you identify and differentiate it from other instances that you may have installed on the same end point. The instance name will be listed in the data directory for the instance as well as in the Add or Remove Programs snap-in. 5. Enter a unique instance name, for example IDG. 6. Click Next to display the Ports configuration dialog box. 7. Leave ports at their default values unless you have conflicts with the default values. 8. Click N