Comments on: Remove SCCM Distribution Point Using Powershell Script https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/ SCCM | ConfigMgr | Intune | Windows 11 | Azure Fri, 04 Sep 2020 06:37:13 +0000 hourly 1 https://wordpress.org/?v=6.4.1 By: Harald Bäs-Fischlmair https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-17209 https://www.prajwaldesai.com/?p=15464#comment-17209 In reply to Richard Crews.

You may remove the Site System itself!
Remove-CMSiteSystemServer -SiteSystemServerName $dp -SiteCode $site -Force -ErrorAction SilentlyContinue

The only thing missing is the maintainenance of the orphaned Library on the uninstalled DP ..

I think about creating an CMScript an run the CMScript for deleteing the share and folder of the Content Library after uninstalling the dp role …

]]>
By: Richard Crews https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-16712 https://www.prajwaldesai.com/?p=15464#comment-16712 In reply to Richard Crews.

This wasn’t reliable for me but after a little tweak this ran through 220 DP role removals:

<#

.SYNOPSIS

Remove Distribution Point role using PowerShell Script

.DESCRIPTION 

This scripts lets you uninstall SCCM Distribution Point

.PARAMETER DistributionPoint

This is the server name from which you would be uninstalling Distribution Point role.

.PARAMETER SiteCode

This is 3 letter site code.

.NOTES

Version: 1.0

Published Date: 10-Dec-2016

Updated Date: 21-Apr-2020

Author: Prajwal Desai

Website: https://www.prajwaldesai.com

#>

#Load the Configuration Manager Module

import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + ‘\ConfigurationManager.psd1’)

$Drive = Get-PSDrive -PSProvider CMSite

CD “$($Drive):”

#Site Code and Distribution Point Server Information

$SiteCode = ‘ABC’

$CSVin = “path to csv file”

#Get the content of the CSV file

$Computers = Get-Content -Path $CSVin

#Loop through each Device and perform actions

Foreach ($Name in $Computers){

  #Check if the DP server is alive

  Test-Connection -ComputerName $Name -quiet

  #Remove Distribution Point Role

  write-host -ForegroundColor Green “The Distribution Point Role is being uninstalled on $Name”

  Remove-CMDistributionPoint -Force -SiteCode $SiteCode -SiteSystemServerName $Name

]]>
By: Richard Crews https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-16698 https://www.prajwaldesai.com/?p=15464#comment-16698 Final product for using a CSV with “Computer” as a header:

#Site Code and Distribution Point Server Information

$SiteCode = ‘IND’

$CSVin = “C:\Scripts\Remove-CMDistributionPoint\RemoteDP.csv”

#Get the content of the CSV file

$Computers = Import-Csv $CSVin

#Loop through each Device and perform actions

Foreach ($Computer in $Computers) {

  #Check if the DP server is alive

  Test-Connection -ComputerName $Computer -quiet

  #Remove Distribution Point Role

  write-host -ForegroundColor Green “The Distribution Point Role is being uninstalled on $Computer”

   

]]>
By: Richard Crews https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-16696 https://www.prajwaldesai.com/?p=15464#comment-16696 In reply to Maheswara reddy kesu.

This question is in reference to the Site System role that SCCM removes on its own after a period of time.You are not able to remove it by design.

]]>
By: Richard Crews https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-16695 https://www.prajwaldesai.com/?p=15464#comment-16695 I’ve been referencing your site for years now. This is a great help! I am a PS noob but I hope to get this working with a CSV because I have to remove the DP role from over 200 workstations.

BTW, there is a space after the lesser than sign. I changed:

< #.SYNOPSIS

to:

<#

.SYNOPSIS

]]>
By: Prajwal Desai https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-12440 https://www.prajwaldesai.com/?p=15464#comment-12440 In reply to Maheswara reddy kesu.

Can you be more precise on what exactly you want to remove or uninstall ?.

]]>
By: Maheswara reddy kesu https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-12435 https://www.prajwaldesai.com/?p=15464#comment-12435 How to remove site system?

]]>
By: Ahmed Essam https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-12163 https://www.prajwaldesai.com/?p=15464#comment-12163 What about if i want to remove about 240 DP

]]>
By: Ayrton Walter https://www.prajwaldesai.com/remove-sccm-distribution-point-using-powershell-script/#comment-12128 https://www.prajwaldesai.com/?p=15464#comment-12128 Hello Prajwal!

What if we are trying to discontinue/uninstall permanently offline DPs?
Is the same procedure applicable?

Regards

]]>