Installing SCOM UR patch on remote computers

SCOM UR

In this short articile you will find out how to install SCOM UR patch remotely. In one of the previous articile you can check also how to get information about UR version from remote machines.

Installing SCOM UR

Below you can find simple example for installing patch 2012 R2 UR14:

UR Patch
UR Patch

In my case patch with .msp extension was located on d: drive:

$URPatch = "d:\SCOM\SCOM 2012 R2 UR14\*.msp"
$PatchName = (Get-ChildItem $URPatch).Name

First script will create folder d:\temp on remote server and then copy patch file using Start-BitsTransfer command. Next it will start msiexec process with parameters to install UR.

Final script:


$Servers = Get-Content "c:\users\$env:username\desktop\servers.txt"
$URPatch = "d:\SCOM\SCOM 2012 R2 UR14\*.msp"
$PatchName = (Get-ChildItem $URPatch).Name

foreach ( $Srv in $Servers ) {
   #Creating folder on remote machine
   icm -cn $Srv { $fl = Test-Path "d:\temp"; if ( -not $fl) { New-Item "d:\temp" -type directory } }
   #Copying files to remote server	
   Start-BitsTransfer -Source $URPatch -Destination "\\$Srv\D$\temp\"
   #Installing SCOM agent Patch
   icm -cn $Srv {param($PatchName) Start-Process -Wait "c:\windows\System32\msiexec.exe"  -ArgumentList @("/p","d:\temp\$PatchName /qn", "ADVANCED_OPTIONS=1","CHANNEL=100" ) -PassThru } -ArgumentList $PatchName	
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.