Unsealing a MP to get at the XML using PowerShell or VSAE

I was out at a clients site the other day and he asked me how he could view the XML in a sealed Management Pack. Most of you reading this probably would jump straight on the SCOM PowerShell cmdlets and use those and yes that’s what I’d probably do too out of habit. That said, I recall reading about using Visual Studio Authoring Extensions (VSAE) to do the same thing.

So a quick summary, in PowerShell you’d do something like this:

Get-ScomManagementPack | ? {$_.Name -eq “Microsoft.SQLServer.2012.Monitoring”} | Export-ManagementPack -Path C:\Temp

 

And the result would be the sealed MP is written to our temp folder as an XML file.

But if you’re not much of a typist, we can use VSAE to accomplish the same task.

Firstly open up VSAE and create a new project. This will be using a Management Pack template (remember if you cannot see this option you must download the Visual Studio Authoring Extensions first).

New Project

 

 

Now over on the right hand side of the console in the Solution Explorer, we’ll right click on “Add Reference”.

Add Reference

 

 

 

 

 

 

 

 

 

We’ll select the “Browse” tab and locate the sealed MP file we want to open up. In this case we’ll use the Microsoft SQL Server 2012 Monitoring one I used in the PowerShell example above and click “OK”.

Browse for MP

 

 

 

 

 

 

 

 

 

 

 

 

 

Once the reference has been added, over in the right of the console in the Solution Explorer we’ll see this reference has been added.

View XML

 

 

 

 

 

 

 

 

 

So now we can right click on it, and choose “View XML”.

Extracted XML

 

 

 

 

 

 

And there you go. The fully extracted XML without using Windows PowerShell. Now personally, I still prefer to use Windows PowerShell as it’s been my go-to tool of choice for years now. But this is a pretty cool option especially if you’re already working in VSAE.

Enjoy 🙂

 
Comments

Works only if you do have visual studio available ……
I dont have it … so VSAE is not usable ..

That’s very true…yes it does require Visual Studio. Microsoft do have a free version you can try so if you are able to install it you might wish to give it a go. Otherwise using PowerShell is the other option.

Leave a Reply