{"id":1429,"date":"2014-03-11T22:11:03","date_gmt":"2014-03-11T21:11:03","guid":{"rendered":"http:\/\/sccmfaq.wordpress.com\/?p=1429"},"modified":"2014-03-11T22:11:03","modified_gmt":"2014-03-11T21:11:03","slug":"sccm-2012-get-from-content-id-to-the-name-of-an-application-with-powershell","status":"publish","type":"post","link":"https:\/\/blog.hosebei.ch\/?p=1429","title":{"rendered":"SCCM 2012 &#8211; Get from Content ID to the Name of an Application with Powershell"},"content":{"rendered":"<p>Hey there, here&#8217;s Martin again.<\/p>\n<p>Today I needed to get the Name of an application based on a Content Id from the ContentTransferManager.log:<br \/>\nCTM job {6B767521-D8A8-410B-A572-AF4F6AFD4457} (corresponding DTS job {1EFC1FD9-C3B1-4B25-B879-18EC8F5CD152}) started download from &#8216;http:\/\/$FQDN_DP\/SMS_DP_SMSPKG$\/Content_b6256e4e-0278-4264-8e7c-b8fea60684d5.1&#8217; for full content download.<br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/contentid01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1431\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/contentid01.png?w=300\" alt=\"ContentTransferManager.log\" width=\"300\" height=\"102\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/contentid01.png 1452w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/contentid01-300x103.png 300w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/contentid01-1024x351.png 1024w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/contentid01-768x263.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><!--more--><\/p>\n<p>If you would like the command prepared for you in this blog, you have to copy the string Content_b6256e4e-0278-4264-8e7c-b8fea60684d5.1 (correct it to your appropriate string) and open a Powershell session with a User Account that can connect to the SMS Provider Server through WMI. The SCCM cmdlets are not used within this commands. Define the variable $ContenId01 with this command:<br \/>\n<code>$ContenId01 = ((\"Content_b6256e4e-0278-4264-8e7c-b8fea60684d5.1\").Split(\".\"))[0]<\/code><br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid011.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1434\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid011.png?w=300\" alt=\"PoSh_SCCM_ContentID01\" width=\"300\" height=\"57\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid011.png 721w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid011-300x57.png 300w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now you can get the values of this deployment type, don&#8217;t forget to set your SMS Provider and your SiteCode in the Get-WMIObject command:<br \/>\n<code>Get-WmiObject -Namespace root\\sms\\site_[YOUR SITECODE] -ComputerName [HERE COMES YOUR SMS PROVIDER!] -Class SMS_Deploymenttype -Filter \"ContentID = '$ContenId01'<\/code><br \/>\nBut we don&#8217;t need all of the Information, we only Need the AppModelName Instance, so we put this value into a variable:<br \/>\n<code>$ApplicationID = (Get-WmiObject -Namespace root\\sms\\site_[YOUR SITECODE] -ComputerName [HERE COMES YOUR SMS PROVIDER!] -Class SMS_Deploymenttype -Filter \"ContentID = '$ContenId01' and PriorityInLatestApp = '1'\").AppModelName<\/code><br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid021.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1442\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid021.png?w=300\" alt=\"PoSh_SCCM_ContentID02\" width=\"300\" height=\"59\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid021.png 865w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid021-300x60.png 300w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid021-768x153.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>With this Information, we now can kindly ask the class SMS_Application to tell us the Name of the Application. This PoSh-Command will serve us this:<br \/>\n<code>(Get-WmiObject -Namespace root\\sms\\site_[YOUR SITECODE] -ComputerName [HERE COMES YOUR SMS PROVIDER!] -Class SMS_Application -Filter \"CI_UniqueID like '$ApplicationID%' and IsLatest = 'True'\").LocalizedDisplayName<\/code><\/p>\n<p>Your Powershell console should look like this:<br \/>\n<a href=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1437\" src=\"http:\/\/hosebei.wordpress.com\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid03.png?w=300\" alt=\"PoSh_SCCM_ContentID03\" width=\"300\" height=\"83\" srcset=\"https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid03.png 868w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid03-300x84.png 300w, https:\/\/blog.hosebei.ch\/wp-content\/uploads\/2014\/03\/posh_sccm_contentid03-768x215.png 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Hope this helps someone in the same adventure \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey there, here&#8217;s Martin again. Today I needed to get the Name of an application based on a Content Id from the ContentTransferManager.log: CTM job {6B767521-D8A8-410B-A572-AF4F6AFD4457} (corresponding DTS job {1EFC1FD9-C3B1-4B25-B879-18EC8F5CD152}) started download from &#8216;http:\/\/$FQDN_DP\/SMS_DP_SMSPKG$\/Content_b6256e4e-0278-4264-8e7c-b8fea60684d5.1&#8217; for full content download.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,35],"tags":[],"class_list":["post-1429","post","type-post","status-publish","format-standard","hentry","category-application-management","category-sccm-2012"],"_links":{"self":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/1429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1429"}],"version-history":[{"count":0,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=\/wp\/v2\/posts\/1429\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hosebei.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}