A client asked me recently how to determine what Management Packs he had installed in his System Center Operations Manager (SCOM) infrastructure. I told him to open his Management Console and navigate to Administration – Installed Management Packs. It was a short conversation.
Easy peasy, right? Here’s a list, go with G-d. Twenty minutes later, my phone rings again.
“Mitch, how can I export that list so that I can include it in our Infrastructure Documentation?”
Aha… That is a different kettle of fish. For this, we will go into the Operations Manager Shell, essentially the PowerShell console for SCOM. The command most people seem to recommend, to stick to pure PowerShell scripting, would be:
Get-SCOMManagementPack |ConvertTo-Csv | Out-File c:\MPs\InstalledMPs.csv
This will give you a .CSV (comma separated values) file with the following information:
…in other words, way more information than we need. I generally cheat and use the following (from my Batch File days):
This creates a text file with exactly what would be displayed if I ran this cmdlet on the screen…
Ok, that is a lot more useful than the whole CSV list, but I might want to select only the columns I want, and not the ones that PowerShell thinks I want. Let’s try this:
Get-SCOMManagementPack | Select-Object Name,FriendlyName,Description | ConvertTo-Csv | Out-File c:\MPs\InstalledMPs.csv
Now I have a usable file (.csv imported into Excel is a lot more useful than a text file that I can only manipulate in Notepad), that has exactly the information I want… in this case, I have the Name, the Friendly Name, and the Description. My output might now be formatted to look like this:
Much better, don’t you think? If we are doing this for the sake of documentation, we should be able to make it as legible as possible.
Of course, you can choose your objects (columns) as you choose… just replace the names in my Select-Object entry with the ones you want (from the list above, separated by commas). Then you can import your list into Excel. Do not try to open the file in Excel by double-clicking… that will not do anything with your CSV formatting, and it gets ugly.
Leave a Reply