In this post we will see how to remove SCCM distribution point using PowerShell script. From past few weeks I have been working on PowerShell a lot. I see it’s quiet interesting and makes our job easy. In my previous post I showed the installation of distribution point using powershell script. The script is available for download here. The script is really simple and easy to use. We basically make use of Remove-CMDistributionPoint cmdlet. Therefore using this cmdlet we uninstall distribution point. In addition this cmdlet supports the common parameters such as -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. Most of all ensure you are running SCCM 2012 R2 SP1 and above for this script to work. I have tested this script on Configuration Manager current branch versions 1511, 1606, 1610.

Remove SCCM Distribution Point Using Powershell Script

This script removes a distribution point by using a site code and site system role. So before you use this script, specify the following values in the script.

$SiteCode – Provide your site code (3 alphanumeric characters).

$DistributionPoint – Specify the server FQDN from where you want to uninstall DP role.

Script Explanation

Remove-CMDistributionPoint – Removes a distribution point.

-Force – Runs the command without asking for user confirmation.

Copy the below script into a notepad and save it as filename.ps1 extension.

Open the script using Powershell ISE. Substitute site code and distribution point values in the script. Save the script and then run the script. If the distribution point server is online, you will see result as True. In the next step you see the distribution point role is uninstalled from the server.

Remove SCCM Distribution Point Using Powershell Script
Remove SCCM Distribution Point Using Powershell Script

If you have any questions regarding this script, mention it in the comments.