How to extract icons from an existing management pack
Home  » How to extract icons from an existing management pack

How to extract icons from an existing management pack
Posted: Thu, Jul 01, 2010 5:23 PM :: Rank: 94
Author
Points: 7550
Level: System Center Specialist

Does anyone know how to extract icons from existing management packs? I'd like to use some of the Microsoft icons in my own management packs (and Visios for my MPs), but cannot figure out how to extract the icons from within in the MP. 

   Report Abuse
RE: How to extract icons from an existing management pack
Posted: Fri, Jul 02, 2010 5:40 AM :: Rank: 98
Author
Points: 30700
Level: System Center Expert

Hi,

I just tried this, it's actually possible. What you need to do first is to unseal the Management Pack using this

Next, you need to open the XML and search for <images>. You'll see all the images and there's a part called <imagedata>.

Copy everrything in between the imagedata tag and paste it into a HexEditor (tried it with Hex-Editor MX, downloaded it from some german site though).

Save as png. Done.

   Report Abuse
RE: How to extract icons from an existing management pack
Posted: Fri, Jul 02, 2010 7:01 AM :: Rank: 89
Author
Points: 30700
Level: System Center Expert

Actually, it's quite boring to do it this way right? Since I was all out of gum, here you go ;)

Run from Operations Manager Shell. Will get all Images in all Management Packs and drops them in the Destinationpath in a subfolder which has the name of the Management Pack.

Destinationpath has to exist, otherwise the Script will fail.

$DestinationPath = "C:\temp\images"

foreach ($ManagementPack in (get-managementpack))
{
    trap { continue }
    # Create Folder for the MP
    $CurrentFolder = new-item (Join-Path $DestinationPath $ManagementPack.Name) -type Directory

    foreach ($Image in $ManagementPack.GetImages())
    {
            $FileStream = new-Object System.IO.FileStream((Join-Path $CurrentFolder $Image.Name), [System.IO.Filemode]::Create)
            $Image.ImageData.WriteTo($FileStream)
            $FileStream.Flush()
            $FileStream.Close()
            if ($Error.Count -gt 0) { write-host "Couldn't extract Image " $Image.Name " from MP " $ManagementPack.Name; $Error.Clear() }
    }
}

   Report Abuse

Home  » How to extract icons from an existing management pack
Top Contributors
Featured Members
Pete Zerger
Points: 72533
Level: System Center Expert
Tommy Gunn
Points: 47345
Level: System Center Expert
Simon Skinner
Points: 40804
Level: System Center Expert
Andreas Zuckerhut
Points: 30700
Level: System Center Expert
Stefan Koell
Points: 30179
Level: System Center Expert