Build SCCM Console Extension and Custom Right Click Tools for SCCM ConfigMgr. Microsoft PFE Neil Peterson published a blog post to help you create your SCCM console extension Right-click tools. Isn’t it great?
Let’s check the new method for installing SCCM console extensions. SCCM extensions are useful for performing additional actions that are not available with the console’s native installation.
One example of SCCM extensions is the right-click tools. The new console extension installation method was introduced with the 2103 version of ConfigMgr.
The 2012 version of the Configuration Manager console extension applies to SCCM CB versions. So, you should try building the console extension using this method and then publish it to the SCCM Community hub.
- Free SCCM Right Click Tools Community Console Extension
- New Method To Install SCCM Console Extensions.
- Enable Windows 10 Servicing Using SCCM | ConfigMgr | WSUS HTMD Blog (anoopcnair.com).
- Build SCCM Console Extension Right Click Tools YouTube
Build SCCM Console Extension Right-Click Tools
There are several components to consider when considering console extensions for Configuration Manager (2007 or 2012). How do you Build Custom Right-Click Tools for SCCM ConfigMgr Endpoint Manager?
Console Component GUID: This GUID corresponds to the console component where you want to add the custom Action.
Extension Folder: Each custom extension will be created and placed in a specific location for console consumption. This location will vary depending on why the type of console extension is being created and what platform it is being created for (2007 or 2012).
XML File: Each console extension comprises a custom XML file.
Action Executable: Typically, each Console Action extension has an executable (script or otherwise) that is called from the XML file.
I just considered combining Other Useful SCCM Right Click Tools and Add-ons-related links in the same post.
Have a look at the step-by-step explanation and video demonstration in the blog post:
Long Live Right Click Tools – System Center 2012 Configuration Manager Console Extensions
See Console Extension Internals in his words
Console Component GUID – Build SCCM Console Extension
Before determining where to place our custom extension XML file, we must find the GUID corresponding to the console component on which we would like our custom action to be added. In other words, if we want to add our action (right-click tool) to the console’s Software Library / Software Update section, we need to determine the specific GUID for this location.
Likewise, suppose we would like our action (right-click tool) to surface on a collection under the Assets and Compliance node of the 2012 Configuration Manager console. In that case, we need to know the corresponding GUID. To identify these GUID, we must traverse existing root console XML files and manually (or using a script) locate these GUIDES.
If you have done this with 2007, you will recall the root console file as AdminConsole.XML. In 2012, multiple files corresponded to the multiple Configuration Manager nodes. For instance, if you have an action to be placed on the Overview node under Administration, you would search SiteConfigurationNode.XML. For the exercise detailed in this blog (ping all machines in a collection), we will add an extension to device collections underneath the Assets and Compliance node. For this, we will be searching the AssetManagementNode.xml file.
When examining the root console XML files for specific GUIDES, search for NamespaceGuid=<GUID> followed by Id=<Node Description>. The ID will give you a good idea of which console component the GUID belongs to. Note that most console components will have child components; these will not have an ID but rather a Type=’WQL’. It is pretty easy to walk the XML, matching up GUIDs to console components as I go.
A little bit of trial and error helps as well. So, for example, if we open up AssettManagementNode.XML and search for ‘NamespaceGuid=’, the second item (after the root) we will come to is ‘NamespaceGuid=”f10d0965-4b26-4e37-aab5-5400fbbc8eaa” Id=”AssetManagementNodeOverview” ’. Build SCCM Console Extension Right Click Tools for SCCM ConfigMgr
This is the GUID associated with the root of Assets and Compliance or ‘Overview’ displayed in the 2012 Configuration Manager Release Candidate console. Walking to the next ‘NamespaceGuid=’, we come up with ‘NamespaceGuid=”80ea5cfa-5d28-47aa-a134-f455e2df2cd1″ Id=”Users” ’. One more, and we came up with ‘NamespaceGuid=”baaa6910-892f-4d20-9082-b392e5a28a53″ Type=”WQL” ’. We can assume that this is the GUID associated with the user objects.
For this exercise, we want to right-click on a device collection and ping all machines found in that collection. For this purpose, we will use GUID a92615d6-9df3-49ba-a8c9-6ecb0e8b956b.
XML File Location -Build SCCM Console Extension Right-Click Tools
With the console component GUID determined, we can create our XML landing spot or destination folder. With 2012 Configuration Manager, the XML file location will be %Program Files%\Microsoft Configuration Manager\AdminConsole\XmlStorage\Extensions\Actions\<GUID>”. Replace <GUID> with the appropriate GUID. This folder will need to be created. Sometimes, you may also need to create the “\Extensions\Actions\<GUID>” folders.
XML File – Build SCCM Console Extension Right-Click Tools
Here is a sample XML for both 2007 and 2012. Notice that the 2012 XML has slightly changed due to the introduction of the ribbon. The new edition of the ‘ShowOn’ tag allows us to control whether or not the extensions are shown on the ribbon, right-click menu, or both. During this blog, I will only discuss right-click menus and not address adding actions to the ribbon. These two sample XMLs have been taken from the 2007 SDK and the 2012 beta SDK.
System Center Configuration Manager 2007
System Center Configuration Manager 2007
- <ActionDescription Class=”Executable” DisplayName=”Make a Note” MnemonicDisplayName=”Note” Description = “Make a note about software updates”>
- <Executable>
- <FilePath>Notepad.exe</FilePath>
- <Parameters>C:\MyConfigurationManagerNote.txt</Parameters>
- </Executable>
- </ActionDescription>
System Center Configuration Manager 2012
System Center 2012 Configuration Manager
- <ActionDescription Class=”Executable” DisplayName=”Make a Note” MnemonicDisplayName=”Note” Description = “Make a note about software updates”>
- <ShowOn>
- <string>DefaultContextualTab</string>
- <!—RIBBON –>
- <string>ContextMenu</string>
- <!—Context Menu –>
- </ShowOn>
- <Executable>
- <FilePath>Notepad.exe</FilePath>
- <Parameters>C:\MyConfigurationManagerNote.txt</Parameters>
- </Executable>
- </ActionDescription>
PFE Ping Demo Extension XML – Build SCCM Console Extension Right-Click Tools
Here is the XML that will make up the ping console extension. Notice here that the ShowOn tag only includes <string>ContextMenu</string>, unlike the previous SDK samples. I only want the extension to be accessible from the context menu and not the ribbon for this example. Take note of the FilePath tag; this will specify the location of the ping script. Also, note the parameter tag. The ##SUB: CollectionID## will make the collection ID accessible as an argument for our ping script.
PFEPing.XML
- <ActionDescription Class=”Group” DisplayName=”PFE Ping Demo” MnemonicDisplayName=”PFE Ping Demo” Description=”PFE Ping Demo” SqmDataPoint=”53″>
- <ShowOn>
- <string>ContextMenu</string>
- </ShowOn>
- <ActionGroups>
- <ActionDescription Class=”Executable” DisplayName=”Ping Computers” MnemonicDisplayName=”Ping Computers” Description=”Ping Computers”>
- <ShowOn>
- <string>ContextMenu</string>
- </ShowOn>
- <Executable>
- <FilePath>”C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\XmlStorage\Extensions\Actions\a92615d6-9df3-49ba-a8c9-6ecb0e8b956b\PFEPing.vbs”</FilePath>
- <Parameters>##SUB:CollectionID##</Parameters>
- </Executable>
- </ActionDescription>
- </ActionGroups>
- </ActionDescription>
Action Executable- Build SCCM Console Extension
Here is the VBScript that the console extension will execute. Using this script as-is, you will need to specify your site server and site code around line 22 of this script.
PFEPing.vbs
- Set WshShell = WScript.CreateObject(“WScript.Shell”)
- Set objExcel = CreateObject(“Excel.Application”)
- objExcel.Visible = True
- objExcel.Workbooks.Add
- intRow = 2
- objExcel.Cells(1, 1).Value = “Machine Name”
- objExcel.Cells(1, 2).Value = “Results”
- Set objArgs = WScript.Arguments
- IF (objArgs.count > 0) then
- MyPos = InStr(objArgs(0), “:”)
- COLLID = wscript.arguments.item(0)
- END IF
- Set SWbemLocator=CreateObject(“WbemScripting.SWbemLocator”)
- set SWbemServices = SWbemLocator.ConnectServer(” <Site Server> “,”root\SMS\site_ <Site Code> “)
- strQuery = “select * from SMS_CM_RES_COLL_” & COLLID
- Set Computers= SWbemServices.ExecQuery(strQuery)
- for each Computer in Computers
- Ping = WshShell.Run(“ping -n 1 ” & Computer.Name, 0, True)
- objExcel.Cells(intRow, 1).Value = UCase(Computer.Name)
- Select Case Ping
- Case 0 objExcel.Cells(intRow, 2).Value = “On-Line”
- Case 1 objExcel.Cells(intRow, 2).Value = “Off-Line”
- End Select
- If objExcel.Cells(intRow, 2).Value = “Off-Line” Then
- objExcel.Cells(intRow, 2).Interior.ColorIndex = 3
- Else
- objExcel.Cells(intRow, 2).Interior.ColorIndex = 4
- End If
- intRow = intRow + 1
- Next
- objExcel.Range(“A1:B1”). Select
- objExcel.Selection.Interior.ColorIndex = 19
- objExcel.Selection.Font.ColorIndex = 11
- objExcel.Selection.Font.Bold = True
- objExcel.Cells.EntireColumn.AutoFit
Putting it all Together – Build SCCM Console Extension Right-Click Tools
To create the console extension, follow these steps.
- Create the following folder – %Program Files%\Microsoft Configuration Manager\AdminConsole\XmlStorage\Extensions\Actions\a92615d6-9df3-49ba-a8c9-6ecb0e8b956b .
- Create an XML file (of any name) containing the XML from the above PFEPing.XML. Place this in the newly created folder. You may want to change the Display Name, Mnemonic Display Name and Description to something more appropriate for your environment.
- Create a . VBS file using the PFEPing.VBS code from above. Replace <Site Server> with the FQDN of your site server and <Site Code> with your three-character site code. Place the script inside of the folder created in step 1.
- If your console is open, close it out and open it back up.
- Right-click on any collection and execute the extension.
Troubleshooting and Caution: Build SCCM Console Extension
To troubleshoot console extension issues, see the SMSAdminUI.log.
I would discourage creating extensions directly on a site server; I would install the Configuration Manager console on another machine and create them there.
We are on WhatsApp. To get the latest step-by-step guides and news updates, Join our Channel. Click here –HTMD WhatsApp.
Author
Anoop C Nair has been Microsoft MVP from 2015 onwards for 10 consecutive years! He is a Workplace Solution Architect with more than 22+ years of experience in Workplace technologies. He is also a Blogger, Speaker, and leader of the Local User Group Community. His main focus is on Device Management technologies like SCCM and Intune. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security, Career, etc..
Need help anoop,
http://social.technet.microsoft.com/Forums/en-US/configmgrgeneral/thread/92cb8a2d-bb9d-45c0-88ea-f6a35ebedf26