A few weeks ago I was working with a customer on a global SCCM Project where the use of Pull Distribution Points would be a huge benefit to reduce WAN traffic between some of the major sites.
So we ordered a few new (virtual) servers and installed the Distribution Point Role. Everything looked ok, so we moved on and enabled the Pull Distribution Point option, but we couldn’t specify any source for the Pull Distribution Point.
I went back to my lab, where I tried to reproduce this behaivor, but in my lab everything worked just fine.
But my lab was running in HTTP mode and my production was running in HTTPS mode.
After some searching I found this in the docs:
“Although a pull-distribution point supports communications over HTTP and HTTPS, when you use the Configuration Manager console, you can only specify source distribution points that are configured for HTTP. You can use the Configuration Manager SDK to specify a source distribution point that is configured for HTTPS.”
Source: http://technet.microsoft.com/en-us/library/gg712321.aspx#BKMK_DistributionPointConfigurations
Then I started to search for a solution that could help me automate this process for me, and then I found this great script created by an unknown Microsoft PFE, but all credits for the script goes to him
PULLDPSOURCE.VBS
Const cSourceDP = "xxxxxxxxxx.domainname.COM" Const cTargetDP = "xxxxxxxxxx.domainname.COM" Const cServer = "." Const cSitecode = "XXX" Dim NalPAthArray() intsize = 0 Set loc = CreateObject("WbemScripting.SWbemLocator") Set WbemServices = loc.ConnectServer(cServer,"root\SMS\site_" & cSitecode) 'Connect to the site control file Set WbemContext=CreateObject("WbemScripting.SWbemNamedValueSet") WbemContext.Add "SessionHandle",WbemServices.ExecMethod("SMS_SiteControlFile","GetSessionHandle").SessionHandle 'Refresh our copy of the SiteControlFile WbemServices.ExecMethod "SMS_SiteControlFile.Filetype=2,Sitecode=""" & cSitecode & """", "Refresh", , , WbemContext 'Retrieve Site Control Item instances Set WbemInstEnum = WbemServices.ExecQuery("SELECT * FROM SMS_SCI_SysResUse where RoleName='SMS Distribution Point' and NALpath like '%" & cTargetDP & "%'", , , WbemContext) For each wbemInst in WbemInstEnum Wscript.echo "Rolename: " & wbemInst.RoleName wscript.echo "Site Code: " & wbemInst.SiteCode ' Here it breaks: Microsoft VBScript runtime error: Object not a collection For Each Prop In wbemInst.Props if Prop.PropertyName = "IsPullDP" then wscript.echo "Property Name: " & Prop.PropertyName wscript.echo "Property Value: " & Prop.value Prop.value = "1" Prop.Value1 ="0" End if Next Set clsNALMethods = WbemServices.Get("SMS_NAL_Methods") clsNALMethods.PackNALPath Array("Display=\\" & cSourceDP & "\"), "MSWNET", "\\" & cSourceDP, Array("SMS_SITE=" & cSitecode),NALPath For Each Propl in WbemInst.PropLists if Propl.PropertyListName = "SourceDistributionPoints" then wscript.echo "Property List Name: " & PropL.PropertyListName wscript.echo "Value: " & NalPath ReDim Preserve NalPAthArray(intSize) NalPAthArray(intSize) = NalPath intSize = intSize + 1 Propl.values = NalPAthArray wscript.echo "NalPathArray: " & Join(NalPAthArray) End if Next Set SCICompPath = wbemInst.Put_(wbemChangeFlagUpdateOnly, WbemContext) Next 'Commit changes to SC Set InParams = WbemServices.Get("SMS_SiteControlFile").Methods_("CommitSCF").InParameters.SpawnInstance_ InParams.SiteCode = cSiteCode WbemServices.ExecMethod "SMS_SiteControlFile", "CommitSCF", InParams, , WbemContext 'Release SC WbemServices.Get("SMS_SiteControlFile").ReleaseSessionHandle WbemContext.Item("SessionHandle").Value 'Next Wscript.echo "Done"
/Enjoy.
4 Comments
Hmm.. it does not work.
The script even has a line with this:
‘ Here it breaks: Microsoft VBScript runtime error: Object not a collection
Do you have a fix???
I’ve used the script in both my test lab and at a customer without any issues…
I do not seem to work this script..
It even says so in the script source code:
‘ Here it breaks: Microsoft VBScript runtime error: Object not a collection
Do you have a work a round?
This script should work, give a try – https://gallery.technet.microsoft.com/Convert-an-SCCM-2012-fbf19a4d#content