Removing DP from content location
Question
- Hi Leads, I am unable to remove a dp from a particular package where the remove dp option is grayed out only for single package under content location.
I have L3 access to all other packages and have remove options enabled. Am I missing something here?
Answers ( 10 )
Hi Deepu,
Try to remove package by using powershell
https://gallery.technet.microsoft.com/scriptcenter/Remove-Packages-from-af243f41
Thanks Mohan i shall try.
ROHIT : I’m unable remove it from console ( only one Package)
Script might help me. I shall try it in a while and update you all
Hi Deepu,
Can you try to go Administration >Overview>Distribution Points> Select Your DP server.
Now under the Properties of your DP server,Click the “Content” tab and search for that package and try to remove it from here.
Deepu, let us know if this solution worked for you.
@Leads: I shall perform this in dev environment first and update you all by evening
Hi Harjit,
The above script has ran successfully and it says Package aaa was successfully removed from WMI and content library
but when i am running contentlibrarycleanup (whatifmode)its shows as This content library cannot be cleaned up right now because package aaa is not fully installed.
i am removing orphaned content on all DP’s
Noted and thanks.
Changed the question title as this was picked randomly from the question itself when I left question title tab blank.
First of all. Please enter the appropriate name of the question title when you ask one.
I don’t recommend performing this action without taking backup of SCCM/ConfigMgr Or use this with your own risk.
Run the following PS script from the post https://www.cubesys.com.au/how-to-resolve-packages-stuck-in-progress-in-sccm-distribution-points/
All Credits to the owner of the script
$DPName = “yourDP.yourdomain.local “
$PkgID = “CAS018B2”
# ======= DO NOT MODIFY THE BELOW ======= #
$creds = Get-Credential
#remove from wmi
Get-WmiObject -ComputerName $DPName -Namespace Root\SCCMDP -Class SMS_PackagesInContLib -Filter “PackageID = ‘$PkgID’” | Remove-WmiObject
#remove from content library
$ContentLib = Invoke-Command -ComputerName $DPName -Credential $creds -ScriptBlock {(Get-ItemProperty HKLM:SOFTWARE\Microsoft\SMS\DP).ContentLibraryPath}
$driveletter = $ContentLib[0]
$Location = “\\” + $DPName + “\$driveletter$\sccmcontentlib\pkglib”
Set-Location $Location
Remove-Item “$PkgID.INI”
Set-Location $env:SystemDrive
write-host “Done! $PkgID was removed from both WMI and Content Library on $DPName” -ForegroundColor Yellow
Hi Anoop,
The above script has ran successfully and it says Package aaa was successfully removed from WMI and content library
but when i am running contentlibrarycleanup (whatifmode)its shows as This content library cannot be cleaned up right now because package aaa is not fully installed.
i am removing orphaned content on all DP’s