IT Consultant Everyday Notes

Just some problems/solutions storage

Monthly Archives: January 2014

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