{"id":213,"date":"2018-08-21T22:27:10","date_gmt":"2018-08-21T22:27:10","guid":{"rendered":"http:\/\/michaelschultz.net\/tech\/?p=213"},"modified":"2018-08-21T22:27:10","modified_gmt":"2018-08-21T22:27:10","slug":"linking-to-configmgr-reports-through-right-click-tools","status":"publish","type":"post","link":"https:\/\/michaelschultz.net\/tech\/linking-to-configmgr-reports-through-right-click-tools\/","title":{"rendered":"Linking to ConfigMgr Reports through right click tools"},"content":{"rendered":"<p>One of the cool things about ConfigMgr is that you can add in your own tools as right click menu items.&nbsp; There are some really good ones out there.&nbsp; In my environment, I have some GUI tools I have for boundary and collection creation that are used to enforce naming standards as well as perform additional steps to help eliminate human error.&nbsp; I recently decided that I would like to leverage this function to open up ConfigMgr reports and pass the parameters from the console to the report.<!--more--><\/p>\n<p><strong>Determine report URL<\/strong><br \/>\nThe first thing I did was figure out what report I wanted to use and get the URL.&nbsp; I am going to actually change the format of the URL and make some additions to pass the parameter with the URL.<\/p>\n<p>Here is my URL:<\/p>\n<p>http:\/\/reportsvr\/Reports\/report\/ConfigMgr_ABC\/Count_Client_Versions_by_Collection<\/p>\n<p><strong>Determine report parameter(s)<\/strong><br \/>\nUnless you already know the name of the parameter (and I rarely do and I need to standardize my naming), open the report up in Report Builder and expand Parameters.&nbsp; This gives you the name of the parameter.&nbsp; You may also need to look over the query used so you know what the parameter is looking for.<\/p>\n<p>In my case the parameter is COLLID and it is looking for the CollectionID.<\/p>\n<p><strong>Determine where in console to have right click report show<\/strong><br \/>\nThis is where the fun starts.&nbsp; You need figure out the GUID of the menu that you want to add to and this is best done with a script that will automatically display those GUIDs.<\/p>\n<p>I used the script at https:\/\/www.ephingadmin.com\/create-your-own-right-click-tools\/ to show the GUIDs when I right click in the console.&nbsp; That is also where I learned how to make custom right click tools from so it is a good read as I will be repeating info from it.<\/p>\n<p>Here are the common ones I use though<\/p>\n<table style=\"width: 107.82%; height: 140px; border-collapse: collapse;\" border=\"1\">\n<tbody>\n<tr style=\"height: 28px;\">\n<td style=\"width: 36.7%; height: 28px;\"><strong>Right click on\u2026&nbsp;<\/strong><\/td>\n<td style=\"width: 71.12%; height: 28px;\"><strong>GUID<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"width: 36.7%; height: 28px;\">Collection<\/td>\n<td style=\"width: 71.12%; height: 28px;\">a92615d6-9df3-49ba-a8c9-6ecb0e8b956b<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"width: 36.7%; height: 28px;\">Device<\/td>\n<td style=\"width: 71.12%; height: 28px;\">3fd01cd1-9e01-461e-92cd-94866b8d1f39<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"width: 36.7%; height: 28px;\">Package Deployment<\/td>\n<td style=\"width: 71.12%; height: 28px;\">adab1364-cf7d-4b07-8863-e9252e506e62<\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"width: 36.7%; height: 28px;\">Application Deployment<\/td>\n<td style=\"width: 71.12%; height: 28px;\">9a0e2197-51a4-439d-99ea-67edc451a51e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For my report, I see that the GUID is a92615d6-9df3-49ba-a8c9-6ecb0e8b956b<\/p>\n<p><strong>Determine what data can be pulled from console to set parameter<\/strong><br \/>\nOnce I have the GUID, I need find the WQL query used with it to make sure it actually pulls the data I need to pass to the parameter.<\/p>\n<p>There is an XML for each Node under \\AdminConsole\\XmlStorage\\ConsoleRoot in the directory your console is installed under.&nbsp; I found a92615d6-9df3-49ba-a8c9-6ecb0e8b956b in AssetManagementNode.xml and it uses SMS_Collection.<\/p>\n<p>A quick search on SMS_Collection gets me this list of possible data I can pass to my report parameter.<\/p>\n<p>Class SMS_Collection : SMS_BaseClass<br \/>\n{<br \/>\nString CollectionID;<br \/>\nSMS_CollectionRule CollectionRules[];<br \/>\nUInt32 CollectionType;<br \/>\nSInt32 CollectionVariablesCount;<br \/>\nString Comment;<br \/>\nUInt32 CurrentStatus;<br \/>\nBoolean HasProvisionedMember;<br \/>\nSInt32 IncludeExcludeCollectionsCount;<br \/>\nBoolean IsBuiltIn;<br \/>\nBoolean IsReferenceCollection;<br \/>\nUInt8 ISVData[];<br \/>\nUInt32 ISVDataSize;<br \/>\nString ISVString;<br \/>\nDateTime LastChangeTime;<br \/>\nDateTime LastMemberChangeTime;<br \/>\nDateTime LastRefreshTime;<br \/>\nString LimitToCollectionID;<br \/>\nString LimitToCollectionName;<br \/>\nSInt32 LocalMemberCount;<br \/>\nString MemberClassName;<br \/>\nSInt32 MemberCount;<br \/>\nUInt32 MonitoringFlags;<br \/>\nString Name;<br \/>\nBoolean OwnedByThisSite;<br \/>\nSInt32 PowerConfigsCount;<br \/>\nSMS_ScheduleToken RefreshSchedule[];<br \/>\nUInt32 RefreshType;<br \/>\nBoolean ReplicateToSubSites;<br \/>\nSInt32 ServiceWindowsCount;<br \/>\nBoolean UseCluster;<br \/>\n};<\/p>\n<p>CollectionID is what I need to pass to the parameter and I see that it is included with SMS_Collection.<\/p>\n<p><strong>Formatting URL to pass parameter<\/strong><br \/>\nIn order to include the parameter with report URL, I need to alter the URL.&nbsp; Unfortunately, I do not remember where I learned this as I would link to it.&nbsp; Basically, the URL needs to be changed to reference the use of ReportViewer.aspx.<\/p>\n<p>Here is the URL before and after the change<\/p>\n<p>http:\/\/reportsvr\/Reports\/report\/ConfigMgr_ABC\/Count_Client_Versions_by_Collection<\/p>\n<p>http:\/\/reportsvr\/ReportServer\/Pages\/ReportViewer.aspx?\/ConfigMgr_ABC\/ Count_Client_Versions_by_Collection<\/p>\n<p>We now need to add the command the render to the URL ( &amp;amp;rs:Command=Render )<\/p>\n<p>http:\/\/reportsvr\/ReportServer\/Pages\/ReportViewer.aspx?\/ConfigMgr_ABC\/ Count_Client_Versions_by_Collection&amp;amp;rs:Command=Render<\/p>\n<p>The last part of the new URL is the parameter.&nbsp; The format is {ParameterNameFromReport]=##SUB:[ParameterFromConsole]##<\/p>\n<p>This is the final URL<\/p>\n<p>http:\/\/reportsvr\/ReportServer\/Pages\/ReportViewer.aspx?\/ConfigMgr_ABC\/ Count_Client_Versions_by_Collection&amp;amp;rs:Command=Render&amp;amp;CollID=##SUB:CollectionID##<\/p>\n<p><strong>Creating and placing XML file<\/strong><br \/>\nThe final step is to create and place the XML file.&nbsp; Here is the XML.<\/p>\n<div class=\"codecolorer-container xml default\" style=\"overflow:auto;white-space:nowrap;width:500px;\"><div class=\"xml codecolorer\"><span class=\"sc3\"><span class=\"re1\">&lt;ActionDescription<\/span> <span class=\"re0\">Class<\/span>=<span class=\"st0\">&quot;Group&quot;<\/span> <span class=\"re0\">DisplayName<\/span>=<span class=\"st0\">&quot;Reports&quot;<\/span> <span class=\"re0\">Description<\/span>=<span class=\"st0\">&quot;Custom RCT Created By Necro Monkey&quot;<\/span><span class=\"re2\">&gt;<\/span><\/span> &nbsp;<br \/>\n&nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ShowOn<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;string<span class=\"re2\">&gt;<\/span><\/span><\/span>ContextMenu<span class=\"sc3\"><span class=\"re1\">&lt;\/string<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ShowOn<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ActionGroups<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ActionDescription<\/span> Class =<span class=\"st0\">&quot;Executable&quot;<\/span> <span class=\"re0\">DisplayName<\/span>=<span class=\"st0\">&quot;Client Versions&quot;<\/span> <span class=\"re0\">MnemonicDisplayName<\/span>=<span class=\"st0\">&quot;Client Versions&quot;<\/span><span class=\"re2\">&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ShowOn<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;string<span class=\"re2\">&gt;<\/span><\/span><\/span>ContextMenu<span class=\"sc3\"><span class=\"re1\">&lt;\/string<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ShowOn<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ImagesDescription<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ResourceAssembly<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;Assembly<span class=\"re2\">&gt;<\/span><\/span><\/span>AdminUI.UIResources.dll<span class=\"sc3\"><span class=\"re1\">&lt;\/Assembly<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;Type<span class=\"re2\">&gt;<\/span><\/span><\/span>Microsoft.ConfigurationManagement.AdminConsole.UIResources.Properties.Resources.resources<span class=\"sc3\"><span class=\"re1\">&lt;\/Type<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ResourceAssembly<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ImageResourceName<span class=\"re2\">&gt;<\/span><\/span><\/span>Add<span class=\"sc3\"><span class=\"re1\">&lt;\/ImageResourceName<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ImagesDescription<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;Executable<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;FilePath<span class=\"re2\">&gt;<\/span><\/span><\/span>&quot;C:\\Program Files\\internet explorer\\iexplore.exe&quot;<span class=\"sc3\"><span class=\"re1\">&lt;\/FilePath<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;Parameters<span class=\"re2\">&gt;<\/span><\/span><\/span>http:\/\/reportsvr\/reportserver?\/ConfigMgr_ABC\/Count_Client_Versions_by_Collection<span class=\"sc1\">&amp;amp;<\/span>rs:Command=Render<span class=\"sc1\">&amp;amp;<\/span>COLLID=##SUB:CollectionID##<span class=\"sc3\"><span class=\"re1\">&lt;\/Parameters<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/Executable<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ActionDescription<span class=\"re2\">&gt;<\/span><\/span><\/span> &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n&nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ActionGroups<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n<span class=\"sc3\"><span class=\"re1\">&lt;\/ActionDescription<span class=\"re2\">&gt;<\/span><\/span><\/span><\/div><\/div>\n<p>I then copy the XML file into the appropriate folder for the GUID<\/p>\n<p>C:\\Program Files (x86)\\Microsoft Configuration Manager\\AdminConsole\\XmlStorage\\Extensions\\Actions\\a92615d6-9df3-49ba-a8c9-6ecb0e8b956b<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the cool things about ConfigMgr is that you can add in your own tools as right click menu items.&nbsp; There are some really good ones out there.&nbsp; In my environment, I have some GUI tools I have for boundary and collection creation that are used to enforce naming standards as well as perform &hellip; <a href=\"https:\/\/michaelschultz.net\/tech\/linking-to-configmgr-reports-through-right-click-tools\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linking to ConfigMgr Reports through right click tools&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-213","post","type-post","status-publish","format-standard","hentry","category-configmgr"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p98a2r-3r","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":5,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/213\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}