Automate SCOM 2012 SP1 Prerequisites Installation with PowerShell by Richard Qi

System Center 2012 SP1 is now available for public download. I am actually refreshing few demo labs I have. System Center Operation Manager is one those components in System Center actually has quite few prerequisites.

Configuring these prerequisites can be frustrating, especially if you are doing it for the first time. There is a way to actually simply this by using PowerShell, which is pretty much the coolest tool for efficiency.

The real credit of this goes to Kevin Greene, a system center MVP, who posted a details blog post on this.

Here are the two scripts that I often use for Combined Management server deployment of SCOM2012 SP1.

Windows Server 2008 – Combined Management
Server, Operations Console and Web Console Roles PreReq
Script

#This section will
install all the Windows Server 2008 Roles and Feature Prereqs for the Web
Console Role#
import-module
servermanager
Add-WindowsFeature
NET-Framework-Core,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,AS-HTTP-Activation
–restart

#This section will download the Report Viewer Distributable
Prereq for the SCOM 2012 SP1 Operations Console role on Windows Server 2008 to a folder on the C:\ drive called
SCOM2012SP1Prereqs and will then install it automatically #

$dwnld =
“C:\SCOM2012SP1Prereqs”
if (!(Test-Path -path
$dwnld))
{
New-Item $dwnld -type directory
}
$object = New-Object
Net.WebClient
$RPTurl =
‘http://download.microsoft.com/download/E/A/1/EA1BF9E8-D164-4354-8959-F96843DD8F46/ReportViewer.exe’
$object.DownloadFile($RPTurl,
“$dwnld\ReportViewer.exe”)
Start-Process
-FilePath “$dwnld\ReportViewer.exe” -ArgumentList /q -Wait

#This section will
download the .NET Framework 4.0 Redistributable Prereq for Windows Server 2008
to a  folder on the C:\ drive called
SCOM2012SP1Prereqs and will then install it automatically#

$dwnld =
“C:\SCOM2012SP1Prereqs”
if (!(Test-Path -path
$dwnld))
{
New-Item $dwnld -type directory
}
$object = New-Object
Net.WebClient
$RPTurl =
‘http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe’
$object.DownloadFile($RPTurl,
“$dwnld\dotNetFx40_Full_x86_x64.exe”)
Start-Process -FilePath “$dwnld\dotNetFx40_Full_x86_x64.exe”
-ArgumentList /q -Wait

#This section will enable the ISAPI and CGI extensions for
IIS and .NET 4.0 once the .NET 4.0 redistributable has been
installed#
c:\windows\system32\inetsrv\appcmd
set config /section:isapiCgiRestriction
/[path=`’C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll`’].allowed:True

Click here to download this PowerShell script as a .PS1 file

 

Windows Server 2012 – Combined Management
Server, Operations Console and Web Console Roles PreReq
Script

#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 the Report Viewer
Distributable 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://download.microsoft.com/download/E/A/1/EA1BF9E8-D164-4354-8959-F96843DD8F46/ReportViewer.exe’
$object.DownloadFile($RPTurl,
“$dwnld\ReportViewer.exe”)
Start-Process -FilePath “$dwnld\ReportViewer.exe”
-ArgumentList /q -Wait
Click here to download this PowerShell script as a .PS1 file

Related Posts

One Response to “Automate SCOM 2012 SP1 Prerequisites Installation with PowerShell”

  1. Avatar

    Tom Floor

    For Windows Server 2012R2 with SCOM 2012 R2 preview, you only need to add the Windows-Identity-Foundation to the powershell script to be able to install SCOM.

    Reply

Leave a Reply