Freigeben über


A simple way to apply hotfixes to a whole bunch of servers

I was recently challenged with how to apply a whole lot of hotfixes to a bunch of servers so I came up with this solution using PSexec from Sysinternals that can be downloaded here https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

First I need to download and extract all of the hotfixes I need to install

2012 Clustering https://support.microsoft.com/kb/2784261

2012 Hyper-v https://social.technet.microsoft.com/wiki/contents/articles/15576.hyper-v-update-list-for-windows-server-2012.aspx

I had some challenges with getting WUSA to execute remotely so I needed to get the Hotfixes locally on each host. To accomplish this a simple batch file that makes a directory called "hotfix" on the root of C:\ for each host in my text file "ALL_hosts_Cluster_Nodes.txt"

for /f %%a in (ALL_hosts_Cluster_Nodes.txt) do mkdir c:\hotfix
for /f %%a in (ALL_hosts_Cluster_Nodes.txt) do xcopy /d/y \\srourceserver\c$\scripts\Hotfixes\*.msu /i \\%%a\c$\hotfix\

That was pretty quick and easy. Now I have all the Server 2012 hotfixes for hyper-v and clustering locally on each server.  

Next I created another batch file using the same server list. Save the contents below to install.bat.

psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2785638-v2-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2795531-v2-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2795997-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2796000-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2806542-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2823643-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2823956-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2825135-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2832478-v2-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2834026-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2836402-v2-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2838043-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2838669-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2840681-x64.msu /passive /quiet /norestart
psexec -s @ALL_hosts_Cluster_Nodes.txt wusa c:\hotfix\Windows8-RT-KB2848344-x64.msu /passive /quiet /norestart

Then just execute install.bat file and bam.

Success! = output of  wusa exited on rrvmash26 with error code 3010.

Don't forget to restart your servers after applying the updates.

 Thanks!

Trent
CISSP, ITILv3, MCP

This posting is provided "AS IS" with no warranties, and confers no rights

Comments

  • Anonymous
    August 08, 2013
    don't forget powershell - it could have done the process much more efficiently

  • Anonymous
    August 08, 2013
    Very helpful, thanks

  • Anonymous
    August 08, 2013
    Yes @Jimbo there are many ways to accomplish the same task. For me a simple batch file that took me literally just a few minutes to create was sufficient.