IT Consultant Everyday Notes

Just some problems/solutions storage

SCOM 2012 R2: Prerequisites installation script

Inspired by this script  by Richard Qi I created a modified version for SCOM 2012 R2 on Windows Server 2012. The difference is Report Viewer 2012 (and its prerequisite – SQL Control Types)

Here is the script content (copy it to .ps1 file and run from Power Shell)

NOTE: ReportViewer URL is updated April 14th 2014

#This section installs the .NET and IIS Prereqs for Windows Server 2012#
Import-Module ServerManager
Add-WindowsFeature NET-Framework-Core,AS-HTTP-Activation,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Http-Logging,Web-Request-Monitor,Web-Filtering,Web-Stat-Compression,AS-Web-Support,Web-Metabase,Web-Asp-Net,Web-Windows-Auth –restart#This section will download SQL System CLR and the Report Viewer 2012 Runtime Prereq for Windows Server 2008 or Windows Server 2012#
#to a folder called C:\SCOM2012SP1Prereqs. Once the file has been downloaded it will automatically install       #

$dwnld = “C:\SCOM2012SP1Prereqs”
if (!(Test-Path -path $dwnld))
{
New-Item $dwnld -type directory
}
$object = New-Object Net.WebClient

$RPTurl = ‘http://go.microsoft.com/fwlink/?LinkID=239644&clcid=0x409′
$object.DownloadFile($RPTurl, “$dwnld\SQLSysClrTypes.msi”)
Start-Process -FilePath “msiexec.exe” -ArgumentList ” -i $dwnld\SQLSysClrTypes.msi /qb” -Wait

$RPTurl = ‘http://download.microsoft.com/download/F/B/7/FB728406-A1EE-4AB5-9C56-74EB8BDDF2FF/ENU/x86/ReportViewer.msi
$object.DownloadFile($RPTurl, “$dwnld\ReportViewer.msi”)
Start-Process -FilePath “msiexec.exe” -ArgumentList ” -i $dwnld\ReportViewer.msi /qb” -Wait

Advertisements

One response to “SCOM 2012 R2: Prerequisites installation script

  1. Ryan May 7, 2014 at 7:40 pm

    Need a line break on line 5 after the “-restart” before the “#”. Otherwise, great script.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: