SCCM 2012 – Get from Content ID to the Name of an Application with Powershell

Hey there, here’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 ‘http://$FQDN_DP/SMS_DP_SMSPKG$/Content_b6256e4e-0278-4264-8e7c-b8fea60684d5.1’ for full content download.
ContentTransferManager.log

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:
$ContenId01 = (("Content_b6256e4e-0278-4264-8e7c-b8fea60684d5.1").Split("."))[0]
PoSh_SCCM_ContentID01

Now you can get the values of this deployment type, don’t forget to set your SMS Provider and your SiteCode in the Get-WMIObject command:
Get-WmiObject -Namespace root\sms\site_[YOUR SITECODE] -ComputerName [HERE COMES YOUR SMS PROVIDER!] -Class SMS_Deploymenttype -Filter "ContentID = '$ContenId01'
But we don’t need all of the Information, we only Need the AppModelName Instance, so we put this value into a variable:
$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
PoSh_SCCM_ContentID02

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:
(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

Your Powershell console should look like this:
PoSh_SCCM_ContentID03

Hope this helps someone in the same adventure 🙂

8 thoughts on “SCCM 2012 – Get from Content ID to the Name of an Application with Powershell

  1. Hi, great script! Makes my life much easier 🙂

    I simplified the readability of your script a little bit:

    # Settings
    $SiteCode = ‘A00’
    $Server = ‘KSQLAPPSC01’
    $ContentID = ‘Content_b051377e-9e9d-4355-a3af-f5f4fc6cecaf.1’

    Get-WmiObject -Namespace rootsmssite_$SiteCode -ComputerName $Server -Class SMS_Deploymenttype -Filter “ContentID = ‘$($ContentID.Split(“.”)[0])'” | Select LocalizedDisplayName -Unique

  2. Hey Kenneth I tried you script with no success

    # Settings
    $SiteCode = ‘US3’
    $Server = ‘Servername from CAS.log’

    $ContentID = ‘Content_bcffbcbb-6fbb-4b9d-b816-8c20b8e2fa13.1’
    Get-WmiObject -Namespace rootsmssite_ $SiteCode -ComputerName $Server -Class ccm_Deploymenttype -Filter “ContentID = ‘$($ContentID.Split(“.”)[0])’” | Select LocalizedDisplayName -Unique

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s