SCOM 2012 R2: Unattended installation / Command Line

March 10, 2014 at 3:21 pm in Uncategorized by Christopher Keyaert

Today, let’s focus on the PowerShell Command line that you could use to silently install SCOM to your environment.
The scripts below are for System Center Operations Manager 2012 R2 and Windows Server 2012 R2.

Prerequisites installation

One of the first SCOM prerequisites is to install Report View, which also has the installation of SQL Sys CLR as prerequisite. The few lines below will take care of the installation of these components.

$dwnld = 'C:\SCOM2012R2Prereqs'
if (!(Test-Path -path $dwnld))
 {
 New-Item $dwnld -type directory
 }
$object = New-Object Net.WebClient
$RPTurl = 'http://download.microsoft.com/download/F/B/7/FB728406-A1EE-4AB5-9C56-74EB8BDDF2FF/ReportViewer.msi'
$object.DownloadFile($RPTurl, "$dwnld\ReportViewer.msi")

$RPTurl = 'http://go.microsoft.com/fwlink/?LinkID=239644&clcid=0x409'
$object.DownloadFile($RPTurl, "$dwnld\SQLSysClrTypes.msi")

Start-Process -FilePath "$dwnld\SQLSysClrTypes.msi" -ArgumentList '/q' -Wait
Start-Process -FilePath "$dwnld\ReportViewer.msi" -ArgumentList '/q' -Wait
   

First management server installation

The line below is taking care of the installation of you first management server. Change the parameters to first to your needs.

Start-Process -FilePath E:\setup.exe -ArgumentList '/install /InstallPath:"C:\Program Files\Microsoft System Center 2012 R2\Operations Manager" /components:OMServer,OMConsole /ManagementGroupName:SCOMMgmt /SqlServerInstance:SQLSERVER\Instance /DatabaseName:OperationsManager /DWSqlServerInstance:SQLSERVER\Instance /DWDatabaseName:OperationsManagerDW /ActionAccountUser:Contoso\Administrator /ActionAccountPassword:'XXXX' /DASAccountUser:contoso\Administrator /DASAccountPassword:'XXXX' /DatareaderUser:domhome\Administrator /DatareaderPassword:'XXXX' /DataWriterUser:domhome\Administrator /DataWriterPassword:'XXXX' /EnableErrorReporting:Never /SendCEIPReports:0 /UseMicrosoftUpdate:0 /AcceptEndUserLicenseAgreement:1 /silent'
   

Other management server installation

Oncec the first management server has been successfully installed, you could use the line below to install the others.

Start-Process -FilePath E:\setup.exe -ArgumentList '/install /InstallPath:"C:\Program Files\Microsoft System Center 2012 R2\Operations Manager" /components:OMServer,OMConsole /SqlServerInstance: SQLSERVER\Instance /DatabaseName: OperationsManager /ActionAccountUser:Contoso\Administrator /ActionAccountPassword:'XXXX' /DASAccountUser:Contoso\Administrator /DASAccountPassword:'XXXX' /EnableErrorReporting:Never /SendCEIPReports:0 /UseMicrosoftUpdate:0 /AcceptEndUserLicenseAgreement:1 /silent'
  

Web Console installation

The installation of the Web Console needs first to enable some Windows Features. The Script below is taking care of all that.

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,Web-Mgmt-Console,Web-Metabase,Web-Asp-Net,Web-Windows-Auth,Web-ASP,Web-CGI -Restart

Add-WindowsFeature Web-Asp-Net45,AS-HTTP-Activation

Start-Process -FilePath E:\setup.exe -ArgumentList '/silent /install /components:OMWebConsole /ManagementServer:SCOM.constoso.local /WebSiteName:'Default Web Site' /WebConsoleAuthorizationMode:Mixed /SendCEIPReports:0 /UseMicrosoftUpdate:0 /AcceptEndUserLicenseAgreement:1'
   

Have a nice day!
Cheers

Christopher