ConfigMgr 2012 support tip: Migrating an application to a new hierarchy creates new Content ID

~ John Philpott

FIXHi everyone, John Philpott here with a quick tip for you on an issue where applications may get a new content ID after migrating to a new System Center 2012 R2 Configuration Manager Service Pack 1 (SP1) environment.

The Scenario

You are migrating your current System Center 2012 Configuration Manager infrastructure to a new ConfigMgr 2012 R2 SP1 environment. Your original environment includes applications which are to be migrated over to the new environment. To allow for a phased migration, you have set up shared distribution points in the original environment.

The Problem

Once you migrate your applications to the new ConfigMgr 2012 R2 SP1 environment, you find that a large number of those applications have received a new Application Deployment Type Content_UniqueID. This causes clients to not be able to download content in the new environment from the shared distribution point, as they do not recognize the Content_UniqueID.

The Cause

This can occur if the applications that were created had a source directory that didn't end with a backslash (the \ character). This is because in ConfigMgr 2012 R2 SP1, any application created that doesn't have the trailing '\' in its source gets it added automatically.

The Resolution

To resolve this issue, or to prevent it from happening in the first place, from the old site, update the source path to include a trailing ‘\’ on any application that is missing one (or any app that is getting a new Content_UniqueID after migration).

If you have not begun your migration yet, no further steps are required. If you have discovered this issue post migration, after you complete the step above, re-migrate the application using the “overwrite” option.

After these steps, migrated applications will maintain the same Content_UniqueID.

Optional Script

PFE Ken Smith wrote a PS script that will scan for, and optionally correct, application deployment types that are missing a trailing '\' in the content location path. His sample script can be found below:

# Ken Smith
# Microsoft Premier Field Engineer (PFE)
# 9/2/2015
# Rev 1.0
# This script will scan for, and optionally correct, application deployment types that are missing a trailing "\"
# in the content location path. This will allow for proper migration to 2012 SP2/R2 SP1 without generating a new ContentID
# Usage: Verify-ContentLocation -SiteCode <SiteCode> -FixMe <$True> (Optional)
# This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. 
# We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object
# code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software
# product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the
# Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims
# or lawsuits, including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
CD "$($SiteCode):\"
$LogFile = "$($Env:Temp)\Verify-ContentLocation$(get-date -Format HHmmss).txt"
Write-Host "Logging to $LogFile"
Function LogWrite {
    Write-Host $logstring
    Add-Content -Path $LogFile -Value $logstring
LogWrite "Gathering Applications"
$apps = Get-CMApplication
foreach ($app in $apps)
LogWrite "Processing Application $($app.LocalizedDisplayName)"
    $SDMXML = [XML]$App.SDMPackageXML
    $DeploymentTypes = $SDMXML.AppMgmtDigest.DeploymentType
foreach ($DeploymentType in $DeploymentTypes)
        If ($DeploymentType.Technology -eq "Script" -or $DeploymentType.Technology -eq "MSI") {
            If(-Not $DeploymentType.Installer.Contents.Content.Location.EndsWith("\")){
                LogWrite "...found corrupt ContentLocation - $($DeploymentType.Title.InnerText) - $($DeploymentType.Installer.Contents.Content.Location)"
                If ($fixme){
                    LogWrite "......setting Content Location - $($DeploymentType.Installer.Contents.Content.Location)\"
                    Set-CMDeploymentType -ApplicationName $app.LocalizedDisplayName -DeploymentTypeName $DeploymentType.Title.InnerText -MsiOrScriptInstaller -ContentLocation "$($DeploymentType.Installer.Contents.Content.Location)\"

NOTE In ConfigMgr 2012 R2 SP1 and/or ConfigMgr 2012 SP2, content paths will always have a trailing ‘\’ appended. Because of this, this issue should not occur with content created using those versions.

DISCLAIMER As with all scripts like this, this script is not supported under any Microsoft support program or service. The sample script above is provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample script remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample script, even if Microsoft has been advised of the possibility of such damages.

John Philpott | Support Escalation Engineer

Get the latest System Center news on Facebook and Twitter:

clip_image001 clip_image002

System Center All Up:

Configuration Manager Support Team blog: 
Data Protection Manager Team blog: 
Orchestrator Support Team blog: 
Operations Manager Team blog: 
Service Manager Team blog: 
Virtual Machine Manager Team blog:

Microsoft Intune:
WSUS Support Team blog:
The RMS blog:
App-V Team blog:
MED-V Team blog:
Server App-V Team blog:
The Surface Team blog:
The Application Proxy blog:

The Forefront Endpoint Protection blog :
The Forefront Identity Manager blog :
The Forefront TMG blog:
The Forefront UAG blog:

ConfigMgr 2012 R2

Comments (1)
  1. David Adams says:

    Some more info on how to use these scripts would be helpful so those of us who don't do this everyday!

Comments are closed.

Skip to main content