DPUpgradeThreadLimit Modification

I’ve recently spent some time with a customer deploying a large amount of Distribution Points in their ConfigMgr 2012 R2 hierarchy. They were finding themselves running into bottlenecks during the deployment, and with the help of the ConfigMgr Product Group, a new Site Control File property modification is now being supported.

Distribution point installations or upgrades may take longer than expected in System Center 2012 Configuration Manager

http://support.microsoft.com/kb/3025353 

The DPUpgradeThreadLimit property by default is set to five. The property should be carefully increased in environments where many Distribution Points are being installed/upgraded in parallel.

As the property is not visible by default, we need to create and set the new property. This will add the property and set it to the $newValue value across all of your Sites.

 This script is provided as-is and provides no warranties. Please thoroughly test in a lab environment, and see the Configuration Manager SDK for more information.

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054

param(
[string] $siteServerName=“.”,
[int] $newValue=10
)

$providerLocation = gcim -ComputerName $siteServerName -Namespace root\sms SMS_ProviderLocation -filter “ProviderForLocalSite=’True'”
$providerMachine = $providerLocation.Machine
$sitecode = $providerLocation.SiteCode
$providerNamespace = “root\sms\site_” + 
$sitecode
$siteFilter
 = “SiteCode='” + $sitecode + “‘”

$distmgrConfig = gcim -ComputerName $providerMachine -Namespace $providerNamespace SMS_SCI_Component | ? {$_.ComponentName -eq “SMS_DISTRIBUTION_MANAGER”}

ForEach ($distMgrObject in $distmgrConfig
)  {

   
$properties = $distMgrObject | select -ExpandProperty Props
    $threadLimitProperty = $properties | ? {$_.PropertyName -eq “DPUpgradeThreadLimit”
} 
   
if($threadLimitProperty -eq $null
)
    {
       
write-host “Previous setting for DPUpgradeThreadLimit was using default, updating to $newValue”
        $newProperty = New-CimInstance -ComputerName $providerMachine -Namespace $providerNamespace -ClassName SMS_EmbeddedProperty
        $newProperty.PropertyName = “DPUpgradeThreadLimit”
        $newProperty.Value = $newValue

        $newPropertyList =
 @()
       
$properties | % { $newPropertyList += $_
}
       
$newPropertyList += $newProperty
   
       
$distMgrObject.Props = $newPropertyList
        scim $distMgrObject
    }
   
else
    {
       
write-host “Previous setting for $($DistMgrObject.SiteCode) DPUpgradeThreadLimit was $($threadLimitProperty.Value), updating to $newValue”
        $newProperty.PropertyName = “DPUpgradeThreadLimit”
        $newProperty.Value = $newValue

        $newPropertyList =
 @()
       
$properties | %
 { 
           
if($_.PropertyName -eq “DPUpgradeThreadLimit”
)
            {
               
$_.Value = $newValue
                $newPropertyList += $_
            }
           
else
            {
               
$newPropertyList += $_
            } 
        } 
   
       
$distMgrObject.Props = $newPropertyList
        scim $distMgrObject }
}