There are a number of blog posts that are out there that explain how to add you own custom icons to Task, Folder, View etc. via editing the management pack in XML but I have not seen one that explains how to add an existing SCSM default icon from an existing management pack.
Below is my run down of how to add a nice icon to a task that appear on Incident work items.
The thing to first realise is that if you create a new task from the console there is NO WAY to add an icon to your new task. The GUI just does not let you select an icon. So to add it you must edit the XML in its raw state. This is not as hard as it sounds and if you focus on the specific items you need and ignore the rest, it is hard to go wrong.
In this example we have a task called “Ping Task” that simply runs Ping.exe (Yes, I know there is one there by default. But this is not about creating a task, this is just about the icon)
1) Firstly, you will need to create the task or tasks you wish to add icons for. This blog post will not cover how to add tasks, However it is important to know that any task you wish to edit the icon for will be stored in a Management Pack and if you wish to change the icon for each Task then you will have to edit each Management Pack.
In this case, I have only one task that I have added.
2) Once you have your task created, export the Management Pack that you created it in. This will save the Management pack to an XML file.
If you open the XML file you will see it looks like the following code:
Now, don’t get bogged down in what each of the elements mean. We are just worried about adding an icon at this stage.
The first thing we need to do with the XML code is to ensure we have a reference to the existing SEALED Management Pack that contains the image we are wanting to use. How do we know what images are in what Management pack? Good question.
Check out Anton Gritsenko’s blog that lists each of the management packs and their associated images.
I chose this image:
Its file name is:
Its Management Pack is:
Once you have found the image that you want to use, make note of the Management Pack that it is in and check the <References> element at the top of the above XML to make sure it is listed.
In the above Management Pack I have added the Microsoft.EnterpriseManagement.ServiceManager.UI.Administration Management Pack and gave it an Alias of “Administration”. I could have quite as easily given it a Alias of “RumpRoast” if I wanted to, the name isn’t important. What IS important is that we use this friendly name to reference anything in that Management Pack throughout our XML.
The Version is important as it has to match the one you have imported in to your SCSM management server and the version may change depending on your version or service pack level so double check by looking in the Administration workspace of your SCSM Console at your Management Packs.
The PublicKeyToken is the same for all MP’s.
Next, we have to find the Task that we created and the ID that has been generated for it.
Tasks have an element tag of <ConsoleTask> and in the example code above it is:
|<ConsoleTask ID=”ConsoleTask.b2b1ee5abd5841a790d8f783e09d93a0″ RequireOutput=”true” Target=”WorkItem!System.WorkItem.Incident” Enabled=”true” Accessibility=”Public”>|
The key piece of information we need to gather is the ID.
With this ID we can now associate images to the task. But before we do that, we need to make sure we have a reference to an image.
To do this we need to add the <ImageReferences> section under the Presentation section. This gives the management pack a reference to an image that is stored either with the current management pack (Must be sealed and contained within a bundled MP) or, in our case, within an existing MP that we can reference.
<ImageReference ImageID=”Administration!Microsoft.EnterpriseManagement.ServiceManager.UI.Administration.Image.Security” ElementID=”ConsoleTask.b2b1ee5abd5841a790d8f783e09d93a0“/>
This reference is pointing to the Administration reference (highlighted red) and is selecting the image within that reference called
Microsoft.EnterpriseManagement.ServiceManager.UI.Administration.Image.Security (highlighted green).
The reference then states what Element ID that this image is related to and in our case it is ConsoleTask.b2b1ee5abd5841a790d8f783e09d93a0 (highlighted blue)
Save the XML, re-import it and that’s it.
You will get a warning that the Management Pack already exists and you may lose data but this is due to the Version number being the same as the one you exported. If you want to avoid this error, just increment the version number in the XML code before importing it.
I hope this helps someone.