web analytics

Blog

How to remove a Distribution Point from a Boundary Group

Posted by:

To remove a Distribution Point from a Boundary Group

  1. Set up a connection to the SMS Provider.
  2. Query a Boundary Group from SMS_BoundaryGroup WMI class
  3. Use the RemoveSiteSystem method.
  4. Set the NALPath property.
  5. Depending on the configuration, set the correct value

Examples

Example Output

You can download the code examples from here


About the Author:

Kaido Järvemets is a developer, consultant, trainer specializing in Microsoft System Center Configuration Manager and PowerShell Solutions at Coretech. Kaido frequently speaks at European conferences and had his US debut as speaker at MMS April 2013. Kaido is well-known in the Configuration Manager communities where he’s a key player in the PowerShell game. Kaido host one of the most complete Configuration Manager PowerShell library’s in the world with hundreds of free code samples ready to download and implement – www.cm12sdk.net. Kaido has been awarded Microsoft Most Valuable Professional (MVP) in Microsoft Enterprise Client Management for his work with Configuration Manager from 2011 – to present. Kaido is the founder of System Center User Group Estonia in 2011.

Discussion

  1. Bin  July 2, 2014

    I had to make a change to the function to get it to work in my environment. I separated the code for the central and the site I want to remove.

    Function Remove-DistributionPointToBoundaryGroup
    {
    [CmdLetBinding()]
    Param(
    [Parameter(Mandatory=$True,HelpMessage=”Please Enter Primary Server Site code”)]
    $centralSiteCode,
    [Parameter(Mandatory=$True,HelpMessage=”Please Enter Primary Server Site code”)]
    $primarySiteCode,
    [Parameter(Mandatory=$True,HelpMessage=”Please Enter Primary Server Name”)]
    $SiteServer,
    [Parameter(Mandatory=$True,HelpMessage=”Please Enter Boundary Group Name”)]
    $BoundaryGroup,
    [Parameter(Mandatory=$True,HelpMessage=”Please Enter Distribution Point server name”)]
    $DistributionPoint,
    [Parameter(Mandatory=$True,HelpMessage=”Please Enter domain name”)]
    $DomainName
    )
    $NALPath = “[“”Display=\\” + $DistributionPoint + “.” + $DomainName + “\””]MSWNET:[“”SMS_SITE=” + “HT2″ + “””]\\” + $DistributionPoint + “.” + $DomainName + “\”

    Try{
    $BoundaryGroupQuery = Get-WmiObject -Namespace “Root\SMS\Site_$centralSiteCode” -Class SMS_BoundaryGroup -ComputerName $SiteServer -ErrorAction STOP -Filter “Name = ‘$BoundaryGroup'”
    $BoundaryGroupQuery.RemoveSiteSystem($NALPath)
    }
    Catch{
    $_.Exception.Message
    }
    }

    Remove-DistributionPointToBoundaryGroup -CentralSiteCode “STX” -SiteServer “sccmcs1″ -PrimarySiteCode ST2 -BoundaryGroup “Anyconnect” -DistributionPoint “sccmss1″ -DomainName “test.lcl”

    (reply)

Add a Comment