Scenario: You have a lot of Windows Updates and Hotfixes that you need to install manually. You want to do the following:
- Script the install
- Do not restart the server after the update is installed — (so you can manually restart it when you are ready)
Scriptlets:
Download the updates to a folder and copy that folder to the servers requiring the update.
#Collect your Servers into a variable $Servers = Get-exchangeserver ex* #Create an folder to copy your updates to $Servers.name | %{ MD \$_c$updatesCluster_Updates } #Copy your updates to that new folder $servers.name | %{ Copy-item "C:Cluster_updates*.msu" "\$_c$updatesCluster_updates"
Install the updates on each server by running the following command from an elevated command prompt:
FOR %h IN (*.msu) DO START /WAIT WUSA %h /QUIET /NORESTART
To verify the updates are installed on each one of your servers, run the following PowerShell commandlet:
$servers.name | %{ get-hotfix -computername $_ | Where InstalledOn -gt 2/5/2017}