It is rare these days that you only need to import a single management pack into SCOM. Management packs like Windows Server Base, SQL Server and others come with 8 or more management packs. The job can get tedious when you have to do it over and over again.
I searched the internet for help and found a single post by Stefan Roth that shows how to import a list of management packs using Import-SCOMManagementPack. One of the benefits of this method is that the list of management packs are automatically imported in the correct order, so if you have a Library management pack that if referenced by a another management pack in the list, the library management pack will be imported first, neat!
After several hours in the lab, I experienced multiple failures, which turned out to be that there were existing management packs already imported, which caused the cmdlet to fail.
I have created a new PowerShell script that will pull in the list of management packs from a folder and compare the list to already installed management packs. So, this script will only import the management packs that are missing.
To start, you need to download and install the management packs on the Operation Manager management server you will be running the script from. If you do not want to manually download the management packs, you use this PowerShell script available here from Stanislav Zhelyazkov.
I am working on a PowerShell Desired State Configuration (DSC) version of the script that will do all the above, but will have to save that for another post, so stay tuned!
#$mpdir = “C:\Files\126.96.36.199”
Write-Host “Script is requesting to import $mpcnt management packs.”
$InstallList = @()
$Instcnt = $InstallList.Count
If ($Instcnt -gt 0)