ConfigMgr 12

ConfigMgr 2012 R2 PowerShell to Install SMP Role

Posted on Updated on

In a recent customer engagement, we needed to mass deploy the State Migration Point (SMP) role to nearly 70 servers.  After completing about a dozen of these one by one, I thought PowerShell would be a much faster way to accomplish the end goal.  The below script can be used as an example for finding existing site systems that do not have the SMP role installed, while allowing it to skip servers with certain names (in this example, it skips servers that begin with TEST in the name).


import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
# Site Code + :
$SiteCode = "GAL:"
Set-Location $SiteCode

#Properties for Setting the SMP Role
$UsmtDrivePath = "F:\USMT"
$MaxNumClients = 100
$MinFreeSpace = 3
$TimeDeleteAfterDays = 5

$SiteSystemServers = Get-CMSiteSystemServer
write-host $SiteSystemServers.Count

ForEach ($Server in $SiteSystemServers) {
    $ServerName = $Server.NetworkOSPath.Replace("\\", " ")

    $CheckSMP = Get-CMSiteRole -RoleName "SMS State Migration Point" -SiteSystemServerName $ServerName
    #write-host $CheckSMP.Count

	# If SMP Count is zero, SMP not installed
    If ($CheckSMP.Count -eq 0) {
        If ($ServerName.ToUpper().StartsWith("TEST")) {
            # Do Nothing, skip this type of server
        } Else {
            Write-host "No SMP Role, installing on" $ServerName

            $Folder = New-CMStorageFolder -StorageFolderName $UsmtDrivePath -MaximumClientNumber _
				$MaxNumClients -MinimumFreeSpace $MinFreeSpace -SpaceUnit Gigabyte

			Add-CMStateMigrationPoint -SiteSystemServerName $ServerName -StorageFolder $Folder _
				-AllowFallbackSourceLocationForContent $False -EnableRestoreOnlyMode $False -SiteCode $SiteCode _
				-TimeDeleteAfter $TimeDeleteAfterDays -TimeUnit Days
    } Else {
        Write-host "SMP Role installed, skipping server" $ServerName

Finding ConfigMgr Collections with Queries

Posted on Updated on

Using ConfigMgr 2012 R2 (and newer), the following PowerShell script can be used to identify which device collections have a query in them, and those that do not.

Example output:



import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
# Site Code + :
Set-Location "GAL:"

$CollectionList = Get-CMDeviceCollection

ForEach ($Collection in $CollectionList) {
    $RuleName = (Get-CMDeviceCollectionQueryMembershipRule -CollectionId $Collection.CollectionID).RuleName

    If ([string]::IsNullOrEmpty($RuleName)) {
        write-host "NO Query: " $Collection.CollectionID "," $Collection.Name -foregroundcolor Red
    } Else {
        write-host "YES Query:" $Collection.CollectionID "," $Collection.Name ", Query name:" $RuleName

Observations with CU2 install for ConfigMgr 2012 R2 SP1

Posted on Updated on

Recently I updated a customer’s ConfigMgr 2012 R2 SP1 environment with Cumulative Update 2.  It was not exactly a jovial experience, so I thought to share some of the pain points that were experienced.

  1. Total time for CU install was 30 minutes on the primary, with the console update taking the longest time.  Remote console updates took about 15 minutes.
  2. The Release notes say no restart is required, however after the installation, the wizard says a restart is required to complete the changes.
  3. After upgrade/restart, the distribution manager was unavailable…for about 15 minutes.
  4. At that point, ConfigMgr began automatically upgrading all pull DPs with a newer installation.  This is not documented in the release notes that an auto upgrade would happen.
  5. The package transfer manager was locked and unavailable for not quite 2 hours, so content could not transfer.
  6. Some pull DPs failed to upgrade, which is shown in the distmgr.log as well as in the DP Configuration Status.  This also broke communication with SMS Executive on the failed DPs.
    1. The only commonality that I can find that these DPs are all on Windows Server 2008 (non-R2).  However, other DPs on that server were OK.
    2. Distmgr.log also showed error “Failed to copy vcredist_x86.exe to \\server\SMS_DP$\sms\bin\vcredist_x86.exe. GLE = 32”. The vcredist_x86 file had multiple open instances showing in task manager, which needed to be terminated so that the file could be deleted from the bin directory.  Ending those open processes allowed the install to continue.
  7. The CM client package and upgrade package automatically updated across the organization … But there were zero new files in the client install folder.
  8. Buried in the release notes is a post-install task to update the DP for all boot images.

ConfigMgr 2007 to 2012 R2 – Hung Conversions

Posted on Updated on

Recently when helping a customer migrate to ConfigMgr 2012 R2 SP1 + CU1, the site had major problems with fully completing DP upgrades.  First, it would start the uninstall of a CM07 secondary site, then do nothing.  So we would restart the process to which it reassigns the DP and then stalls again…but even worse, it never completed the process and it couldn’t be restarted again.  So the status never came to a full completion and the old content (SMSPKG, PCK files, etc.) were not removed.  Additionally, the state of the migration status never went beyond “Reassigning distribution point” as in the image below.


Ultimately I had to engage Microsoft to get an answer.  Even they had to dig through the SQL stored procedure (sp_MIG_ UpgradeDistributionPoint) to understand for themselves what the conversion process does.  Essentially the stages boil down to these high-level steps:

  1. Uninstall of the 2007 components, then delete the values in MIG_DistributionPointSource in the database
  2. Drop a .dpu file into the  (for more info, see TechNet article “DP converts, but content fails“)
  3. Convert DP values of various package and DP mapping values in SQL
  4. And finally, set the DPUPgrade status where Action=2 and Status=0 for complete.  The example below shows an incomplete “hung” state of a DP with Action=2 and Status=1.


To get these statuses, the following SQL query was used so that we would know when the remote server had completed the uninstall of the secondary site and was ready to have a manual .dpu file dropped in to initiate the content conversion.

-- Result must be empty
select * from MIG_DistributionPointSource where PKGServer like '%ServerName%'

-- Result must have content listed
select * from PkgServers_G where NALPath like '%ServerName%'
select * from PkgServers_L where NALPath like '%ServerName%' 
select * from PkgStatus where PkgServer like '%ServerName%'
select * from ContentDPMap where ServerName like '%ServerName%'
select * from DistributionStatus where DPNALPath like '%ServerName%'

-- Result must have Action=2 and Status=1 to know server is ready to convert content
select * from DPUpgradeStatus where NALPath like '%ServerName%'

-- Use the DDPID number to create the .dpu file name
select * from DistributionPoints where ServerName like '%ServerName%'

The secondary site conversion woes occurred in primarily three ways:

  • First problem – a rerun the stored procedure did not occur after the uninstall of 2007 components.  While this is still unsolved and would take ‘significant’ effort to diagnose the cause, PSS provided a query to identify if the site is ready for the content conversion by creating a dummy .dpu entry.
  • Second problem – A manual restart of the conversion tools led to the system having a “failed to convert content”.  This was occurring because a couple dozen of the packages had mysteriously updated their source files, so there is a hash mismatch between 2007 and 2012.  The solution will be to delete those identified packages in 2012, re-migrate from 2007, and then restart the failed DP conversion (or drop a dummy .dpu)
  • Third problem – On a “completed” DP, files were leftover on the DP, both the PCK and extracted SMSPKG$ files.  Since we did not migrate ALL packages that were on the 2007 DP into 2012, those files are left behind such that they still could be converted at some point if desired.  Otherwise they need to be manually deleted after the conversion process completes.  Then, any package that had a CM07 advertisement that is set to “run from server” will migrate over to CM12 with the option to “Copy content to a package share on DP” – meaning the files in the SMSPKG$ share will remain.  These files should not be deleted from the SMSPKG$, but rather it would be better to change the package setting to not copy the contents (if appropriate for that package).

Why update ConfigMgr clients after upgrades?

Posted on Updated on

I was recently asked by a couple of friends, is it required for me to update my ConfigMgr clients after upgrading my site?  Intuitively I knew the answer and the why, but they need “proof” or documentation from Microsoft that stated it as such.  It was a bit of a needle-in-the-haystack to find, but the following reference on TechNet illustrates the case.

From the guide for Planning to Upgrade System Center 2012 Configuration Manager, in the upgrade checklist, the last step is to Upgrade Clients.

“After you upgrade a primary site, plan to upgrade clients that are assigned to that site. Although a Configuration Manager primary site or secondary site can support communication from clients that have a lower service pack version (including clients that run Configuration Manager SP1 talking to a site that runs System Center 2012 R2 Configuration Manager), this communication should be a temporary configuration. Clients that run a previous service pack version of Configuration Manager cannot use the new functionality that is available with the new version of Configuration Manager.”

ConfigMgr 2012 Site Migration – No Shared Distribution Points

Posted on

Recently when helping a customer with a ConfigMgr 2007 to 2012 R2 upgrade and migration, we were planning to upgrade their secondary sites to standard DPs.  When setting up ConfigMgr 2012 R2 migration tools in the console, none of secondary sites were showing as being available for DP sharing.  In reviewing the site’s migctrl.log file, there was an entry for an error that stated  “The DP is NOT eligible for sharing because no ports between the legacy site and the current site are the same.”


In this case, the customer had configured the 2007 primary site to have clients communicate on a custom port, and not use the standard default port 80, of which the 2012 primary site was configured to use.


By changing 2012 to also use that same custom port, re-running the source hierarchy gathering process, the migration tool (and migctrl.log) now displayed the secondary site servers available for upgrade.

ConfigMgr 2012 R2 – Remote SUP

Posted on Updated on

When setting up ConfigMgr 2012 R2 to use a remote server to host the Software Update Point on Windows Server 2012 R2, configuration of the SUP may fail.  The WCM.log will show entries such as:

Checking for supported version of WSUS (min WSUS 3.0 SP2 + KB2720211 + KB2734608)
Checking runtime v2.0.50727...
Failed to create assembly name object for Microsoft.UpdateServices.Administration. Error = 0x80131701
Checking runtime v4.0.30319...
Did not find supported version of assembly Microsoft.UpdateServices.Administration
Supported WSUS version not found
Remote configuration failed on WSUS Server

The error implies that WSUS 3.0 SP2 is required for the remote SUP, however it is not for Windows Server 2012 R2.  Rather, since the SUP is on a remote server, the WSUS admin console server feature is required to be installed on the primary site server.


ConfigMgr 2012 R2 SP1 – Setup Site Maintenace Unavailable

Posted on Updated on

I recently needed to add multi-language clients that I had missed during the initial install of ConfigMgr 2012 R2 SP1.  Typically this is accomplished through site maintenance of the setup wizard.  New with the ConfigMgr 2012 R2 SP1 install is to first install ConfigMgr “RTM” SP2, then update the server with the lightweight R2 SP1 bits.

But when I ran the setup from the original ConfigMgr 2012 SP2 media, the only options available were to recover a site or uninstall the site.  The option to perform site maintenance was grayed out (see image below)!


Fortunately there was an easy workaround.  Instead of running setup from the media, instead run it from the current ConfigMgr installation directory, under \bin\X64\.  Optionally, run Configuration Manager Setup from the program files menu.  Then voila, the option was available!


ConfigMgr 2012 – Cannot install WSUS on Server 2012 R2

Posted on Updated on

I’ve come across this for a couple of customers. During installation of prerequisites for ConfigMgr 2012 R2 Software Updates, it is necessary to have the server WSUS role installed.  If any domain GPO for WSUS is being applied, it may prevent the installation of the WSUS role on Windows Server 2012 R2. The specific policy is for the “Log on as a service”, which in GPO can be set to restrict access to specific AD groups. WSUS needs to create a local service and grant the logon rights during the install process, even when not selecting the setup to use the Windows Internal Database (WID).

KB2832204 describes the issue precisely, even though it was written with regard to ADFS (and not WSUS). The workaround was to do the following:

  1. Move the server into the Computers container (so the GPO is not applied)
  2. Install WSUS (either as a database on SQL Server or the WID)
  3. Perform the WSUS post install tasks
  4. Move the server back into the proper OU

ConfigMgr 2012 R2 Windows Services

Posted on Updated on

A customer recently asked me what Windows services are used by a ConfigMgr 2012 R2 primary site.  It was a great question, to which I intuitively knew the main services, purposes, and impacts if they were faltering … but I had never seen or compiled such a list before.  In scouring through TechNet, I was unable locate a single source from product documentation.  As such, I created my own (outlined below) which generated from a variant of sources.

Note that SMS Executive is well known to have dozens of “threads” or operations that it performs.  I too could not locate a single source for product documentation with details on those threads.  So if you need that information, I recommend getting a copy of System Center 2012 R2 Configuration Manager Unleashed.

Service Purpose Service Dependencies Affected Functionality
AI Update Service Point Communicates with SC Online for updates to the AI database RPC ConfigMgr Asset Intelligence role
Background Intelligent Transfer Service (BITS) Transfer files in the background using idle bandwidth DCOM, RPC, RPC Endpoint Manager Transfer of content to clients and DPs
SMS Agent Host ConfigMgr client service WMI Site systems with the MP role installed will be impacted
SMS Executive Main ConfigMgr service Network, Network Provider, Workstation All ConfigMgr functionalities
SMS Notification Server Provides ConfigMgr “fast channel notifications” RPC Notification for clients to initiate time-sensitive tasks as soon as possible
SMS Site Backup Executes the ConfigMgr maintenance task for backups Network, Network Provider, Workstation The maintenance task for backups will fail. This is not applicable if using SQL backups and not the ConfigMgr backup task.
SMS Site Component Manager Installs and repairs any ConfigMgr components on site system servers Network, Network Provider, Workstation The ConfigMgr hierarchy will not function correctly
SMS Site SQL  Backup Contributes to the ConfigMgr maintenance task for backups Network, Network Provider, Workstation The maintenance task for backups will fail. This is not applicable if using SQL backups and not the ConfigMgr backup task.
SMS Site VSS Writer Contributes to the ConfigMgr maintenance task for backups Network, Network Provider, Workstation The maintenance task for backups will fail.  This is not applicable if using SQL backups and not the ConfigMgr backup task.
SQL Server (MSSQLSERVER) SQL server for ConfigMgr None All ConfigMgr functionalities
SQL Server Agent Executes jobs, alerts, and tasks SQL Server (MSSQLSERVER) Unable to email alerts
SQL Server Reporting Services SQL reports None Accessing ConfigMgr reports in either the console or website
Windows Deployment Service Server Provides OSD capabilities Ancillary Function Driver, Server, TCP/IP PXE boot, imaging from the server
World Wide Web Publishing Microsoft IIS HTTP, Windows Process Activation ConfigMgr site and client communications, reporting website, application catalog portal
WSUS Service Used by ConfigMgr software updates BITS Processing client scan statistics and compliance, retrieving the