locked
How to set an HTTPS Distribution Point as a Source DP for Pull DP's? RRS feed

  • Question

  •  

    Hi,

    I’ve been going over this article http://technet.microsoft.com/en-us/library/gg712321.aspx to figure out how set an HTTPS DP as a source DP for Pull DP's. HTTPS DP's do not show up as source DP's in the CM12 console while enabling the PULL DP functionality on a remote distribution point.

    The TechNet article states that it should be possible to do so using the CM12 SDK:

    You can configure a pull-distribution point when you install the distribution point or after it is installed by editing the properties of the distribution point site system role. A distribution point that you configure as a pull-distribution point can transfer content to clients by HTTP or HTTPS. When you configure the pull-distribution point, you must specify one or more source distribution points. Only distribution points that qualify to be source distribution points are displayed. Only distribution points that support HTTP can be specified as a source distribution points when you use the Configuration Manager console. However, you can use the Configuration Manager SDK to specify a source distribution point that is configured for HTTPS. To use a source distribution point that is configured for HTTPS, the pull-distribution point must be co-located on a computer that runs the Configuration Manager client. A pull-distribution point can be specified as a source distribution point for another pull-distribution point.

    As my CM12 sites are all running in HTTPS I've been going through the CM12 R2 SDK trying to find a way to specify an HTTPS DP as a Source DP but have been unsuccessful finding the solution. Has anyone done this yet over the SDK , and if so, how??

    Thanks!

    Friday, December 20, 2013 3:32 PM

Answers

  • Have a solution from a premier support tech, this PullDPSource.vbs is NOT in the CM12 SDK although stated in the technet article listed above. Here's how to set an HTTPS DP as a source DP for the PULL DP (https as well):

    • for the Pull DP : update the DP Role settings and set the prestage certificate to the Self Signed certificate (if you set it to your custom cert the script will fail with error "Object not a collection"). If required, you can set the original certificate back once the script has completed.
    • update the script to reflect your Source DP  ->  Const cSourceDP
    • update the script to reflect your Pull DP -> Const cTargetDP
    • update the script to reflect your Sitecode ->  Const cSitecode
    • Save and run this script from an elevated cmd prompt on your primary
    • script now enabled Pull DP option and set the https Source DP


    ----------------------------------------------------

    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"

    -----------------------------------------

    Tuesday, January 21, 2014 1:43 PM

All replies

  • One workaround would be to define the PULL DP settings in the CM12 SQL tables directly:

    dbo.PullDPMap, 

    dbo.PullDPResponse

    and dbo.DistributionPoints | IsPullDP 

    Monday, December 23, 2013 1:56 PM
  • One workaround would be to define the PULL DP settings in the CM12 SQL tables directly:

    dbo.PullDPMap, 

    dbo.PullDPResponse

    and dbo.DistributionPoints | IsPullDP 


    This is completely unsupported and you should NEVER edit the database without contacting CSS for support.

    http://www.enhansoft.com/

    Monday, December 23, 2013 2:00 PM
  • Have a solution from a premier support tech, this PullDPSource.vbs is NOT in the CM12 SDK although stated in the technet article listed above. Here's how to set an HTTPS DP as a source DP for the PULL DP (https as well):

    • for the Pull DP : update the DP Role settings and set the prestage certificate to the Self Signed certificate (if you set it to your custom cert the script will fail with error "Object not a collection"). If required, you can set the original certificate back once the script has completed.
    • update the script to reflect your Source DP  ->  Const cSourceDP
    • update the script to reflect your Pull DP -> Const cTargetDP
    • update the script to reflect your Sitecode ->  Const cSitecode
    • Save and run this script from an elevated cmd prompt on your primary
    • script now enabled Pull DP option and set the https Source DP


    ----------------------------------------------------

    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"

    -----------------------------------------

    Tuesday, January 21, 2014 1:43 PM
  • The VBS does not seem to work on SCCM 2012 R2.

    As an alternative, here is a PowerShell script I wrote for enabling an HTTPS DP as the source for a Pull DP.

    https://gallery.technet.microsoft.com/Convert-an-SCCM-2012-fbf19a4d

    Friday, May 29, 2015 7:23 PM