Create Your Own Right Click Tools – Part 1

2 minute read

Have you ever right clicked on an object in ConfigMgr and not found what you were looking for?  Well ConfigMgr gives you the ability to add options in their right click menus.  This series will teach you how to create your very own right click tool!

Part 1 – Dive into XML!

All nodes and menus in CM2012 have GUIDs associated with them. In order to create a right click tool in the console, you first need to know the GUID of the menu item you want to add it on. You’ll also want to know which WQL class the information is pulled from if you want to pass variables to your tool.

First off, you’ll need XML Notepad, a computer with the ConfigMgr console installed on it, and an idea of where you want this tool.  Recently, I came up with a new Content Status script, and thought it would be nice to have that as a right click option on applications, so you could quickly see where the content was, not just the percent complete.

XML Notepad isn’t required, but I don’t think reading raw XML data is fun so I’m sticking with what’s easy.  Open up XML Notepad and navigate to your ConfigMgr XML directory.  For the default install, it’s: C:Program Files (x86)Microsoft Configuration ManagerAdminConsoleXMLStorageConsoleRoot

Here you have a number of XML files that represent each node of the console. Assets and Compliance – AssetManagementNode.xml Software Library – SoftwareLibraryNode.xml Monitoring – MonitoringNode.xml Administration – SiteConfigurationNode.xml

image

Since I want to put a right click tool in the Software Library node, open SoftwareLibraryNode.xml, and you should see this in XML Notepad:

image

Now, I know you’re expecting an in-depth explanation of what everything does in this XML file, so you’ll have to Google it. My method for finding what I need is I start clicking around until I find something that resembles the Console. I’ll show you what I mean:

image

Expand NodeDescription –> ChildNodes –> RootNodeDescription. If you click on DisplayName, it shows “OverviewNode”, which is the root node you see in the console. When you expand Overview in the console, you have three child nodes (Apps, Updates, OSD), so expand the ChildNodes node in XML Notepad to see three nodes:

image

We want Application Management, which is the first node, so expand the first RootNodeDescription.

image

We want the first child node (Applications), so expand “ChildNodes” and then the first “RootNodeDescription” in “ChildNodes”

image

Now, this is the GUID associated with Applications in software library:

image

If I use this GUID, I’m going to be putting a menu on the Applications node in the left pane of the console. I don’t want a menu option there, I want one in the right pane, where all the applications show up. The console uses WQL queries to fill the right pane up with objects, so in the XML document, expand Queries and then QueryDescription:

image

This is the query used by the console to grab all the application objects. You’ll want to save the NamespaceGuid and the Query for use in parts 2 and 3.

image

Leave a Comment