Version 2.3 of My Script to Download All SCOM Management Packs with PowerShell

Script is update with some small changes all contributed by Anthony Bailey:

  • Improvements on getting the confirmation link for each MP.
  • The script now also grabs the date the MP was added to Microsoft’s catalog and adds this to the logs/screen output 
  • Any duplicate download links are removed before downloading as some download pages have duplicate files in the html 
  • Improvements on check if MP is already downloaded 

Version 2.2 of My Script to Download All SCOM Management Packs with PowerShell

Microsoft has made some changes to the code of the download pages on the MPs so the script was not able to get MP version. Here is full change log:

  • Microsoft has made some changes to the code of the download pages again so the script was not able to get the version of the MP. Made changes to work with the new code.
  • The script now checks if MP web pages is invoked successfully 
  • If MP Page is not invoked successfully error appears. Error is also written in a Error Log.
  • Improvements on check if MP is already downloaded
  • MP download links are displayed on separate lines
  • Changes section was made more readable format

You can download the new version from the following locations:

Version 2.1 of My Script to Download All SCOM Management Packs with PowerShell

Little improvements were made to this script. All of them were contributed by Anthony Bailey:

  • The script now checks if the folder for the version already exists and if only there is not such folder than downloads the MP;
  • When MP is downloaded successfully it is written in a log file;

With these improvements you can run the script with schedule task and configure SCOM to monitor the log that way you can get alerted when new MP is available. All thanks to Anthony Bailey.

Latest version you can find on TechNet Gallery or

Version 2.0 of My Script to Download All SCOM Management Packs with PowerShell

Not so long ago I’ve wrote a script that can download all SCOM Management Packs released by Microsoft. Unfortunately Microsoft has decided to change the interface of their download pages and didn’t asked me for approval Smile. Because of that the script stopped to work as it was dependent on the layout of the download web pages. I’ve decided to give it a try to fix the script. Looked at the layout of the new download page. Change a bit the logic and some lines and viola the script is working again.

You can grab Version 2.0 of the script from TechNet Gallery or from

P.S. The Script requires PowerShell 3.0.

Download All Microsoft Management Packs for SCOM 2007, R2 and 2012 in Bulk with PowerShell

Just last week Daniel Savage published a list on TechNet Wiki with all management packs for OpsMgr 2007, R2 and 2012. A couple of days later Stefan Stranger wrote Finding Management Packs from Microsoft Download website using PowerShell and provided a small PowerShell script that provides a list with the management packs from that site and links to them. After reading that post I was wondering wouldn’t be cool if you get the names of all management packs and their links and download all of them with their guides also. And when you download them to be able to organize them in structure that includes the name of the MP and its version. Instead of writing to Stefan I’ve said to myself – What the hell I will try to make that script. I do not have any big experience with PowerShell and it was not easy to built the script but because I’ve managed to create this proves that PowerShell is easy to learn but you have to be persistent. During the creation of the script I’ve noticed that some of the links on the page were incorrect so I’ve corrected them.

In short the script grabs the names and the links for all management packs on the site. Than it goes trough every MP link. From every MP page gets the version of it and all download links (msi, guides and etc.). Than creates a directory for that MP and subdirectory with the version number and downloads all files in it. The script requires PowerShell v3.

Here is the script:

   1: #Get list of all Management packs and their links from Technet Wiki

   2: #Thanks to Stefan Stranger

   3: $allmpspage = Invoke-WebRequest -Uri ""

   4: $mpslist = $allmpspage.Links | Where-Object {($_.href -like "**download*") -and ($_.outerText -notlike "*Link to download page*") -and ($_.InnerHTML -like "*This link*")} |

   5: Select @{Label="Management Pack";Expression={$_.InnerText}}, @{Label="Download Link";Expression={$_.href}}


   7: #Directory to save the downloaded management packs. Make sure it is created first before running the script

   8: $dirmp = "D:\MPs\"


  10: #go trough every MP

  11: foreach ($mp in $mpslist)

  12: {

  13: #get MP link

  14: $mplink = $mp.'Download Link'


  16: #get MP name

  17: $mpname = $mp.'Management Pack'

  18: Write-Host "MP Name:" $mpname

  19: Write-Host "MP Link:" $mplink


  21: #Read MP page

  22: $mppage = Invoke-WebRequest -Uri "$mplink"


  24: #Find all download links on the page (mp, guide and etc.). $_.href cannot be used beacuse some of the links require conformation before download

  25: $dws = $mppage.Links | Where-Object {($_.'bi:fileurl' -like "**") } | Select @{Label="Download Link";Expression={$_.'bi:fileurl'}}


  27: #Find the version number of the MP on its page

  28: $version = $mppage.ParsedHtml.getElementsByTagName("td") | Where "classname" -contains "col2" | Select -ExpandProperty InnerText


  30: #Remove character ? in fron of MP version. For some reason some versions of mps start with ?

  31: $version = $version.Replace("?","")


  33: #Remove / character from MP name if contains it beacuse can create unneeded directories

  34: $mpname = $mpname.Replace("/","")

  35: Write-Host "MP Version:" $version

  36: Write-Host "Download Links:" $dws


  38: #Create directory with the Name of the MP and subdirecotory with the version of the MP

  39: New-Item -ItemType directory -Path $dirmp\$mpname\$version


  41: #Get the array of found download links

  42: $dws = $dws.'Download Link'


  44: #Get trough every download link

  45: foreach ($dw in $dws)

  46: {

  47: #assign download link to $source variable

  48: $source = $dw


  50: #Get the name of the file that will be downloaded

  51: $Filename = [System.IO.Path]::GetFileName($source)


  53: #Set directory where the file to be downloaded

  54: $dest = "$dirmp\$mpname\$version\$Filename"


  56: #initiate client for download

  57: $wc = New-Object System.Net.WebClient


  59: #download the file and put it in the destination directory

  60: $wc.DownloadFile($source, $dest)

  61: }


  63: #empy line

  64: Write-Host

  65: }

You can download it from TechNet Gallery also.

Once again thanks to Stefan Stranger.