Search This Blog

Thursday 25 September 2014

Operations Manager 2012 – Useful PowerShell Commands and Scripts


As of 01/05/2017, this blog will not be updated or maintained

Here are some useful PowerShell Commands and Scripts that can help you in your environment.

Note : Change the values in red to the standards of your environment.

Install Prerequisites 2012/2012r2 Management Server and/or Console:

$dwnld = 'C:\File_Download_Location\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