none
PowerShell to remove distributed update packages from DPs RRS feed

  • Question

  • Hi,

    I am looking for PS script to remove distributed update packages from multiple DPs, i used below script but getting below error.

    i run the PS script in SCCM Powershell Console. 

     Remove-CMContentDistribution -ApplicationName "Application name" -DistributionPointName "FQDN"

    error: No object corresponds to the specified parameters


    Shailendra Dev

    Monday, April 15, 2019 3:19 PM

Answers

  • Hello Shailendra Dev,
     
    Sorry for this late reply.
     
    Yes. The delete operation is come from the distribution manager on the site server to the destination DP, so its process and the results are recorded in the distmgr.log. 
     
    Besides, we also could verify the results via the content locations of the application/package, the contentlibraryexplorer, the status message, etc.
     
    Hope my answer could help you and look forward to your feedback.
     
    Best Regards,
    Ray

    Please remembers to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Shailendra Dev Wednesday, April 17, 2019 4:54 AM
    Wednesday, April 17, 2019 3:27 AM

All replies

  • Hello Shailendra Dev,
     
    The error message indicates that it can't find the specified application. It would be very helpful if you could double check that if the input is correct.
     
    And we could add "-verbose" to the command to see the detailed information when performing the command and it could help us to find the cause when an error occurs.
     
    Hope my answer could help you and look forward to your feedback.
     
    Best Regards,
    Ray

    Please remembers to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, April 16, 2019 11:15 AM
  • Hi Ray,

    PFB the details that am getting:

    PS CAS:\> Remove-CMContentDistribution -PackageName "Global - Windows 2012 Updates 2018-05" -DistributionPointName "INPN
    Q1SVPS006.test-group.com" -Verbose
    VERBOSE: Start: Execution of WQL query: SELECT * FROM SMS_Package WHERE Name IN ( 'Global - Windows 2012 Updates
    2018-05' )
    VERBOSE: Finish: Execution of WQL query: SELECT * FROM SMS_Package WHERE Name IN ( 'Global - Windows 2012 Updates
    2018-05' ). Processed 0 results in 00:00:00.
    Remove-CMContentDistribution : No object corresponds to the specified parameters.
    At line:1 char:1
    + Remove-CMContentDistribution -PackageName "Global - Windows 2012 Updates 2018-05 ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Microsoft.Confi...ributionCommand:RemoveContentDistributionCommand) [Re
       move-CMContentDistribution], ItemNotFoundException
        + FullyQualifiedErrorId : ItemNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.RemoveContentDistrib
       utionCommand


    Shailendra Dev


    Tuesday, April 16, 2019 12:12 PM
  • What might be better is if you do something like

    Get-CMApplication -Name "" to check the application.

    If wanting to do multiples you could do

    Get-CMApplication -Name "" | ForEach-Object {$_.LocalizedDisplayName} {Remove-CMContentDistribution -ApplicationName $_.LocalizedDisplayName}


    Website: www.walshamsolutions.com Technical Blog: https://www.walshamsolutions.com/technical-blog Personal Blog: https://www.walshamsolutions.com/personal-blog Twitter: Dwalshampro

    Tuesday, April 16, 2019 12:42 PM
  • Hello,

    Notice that it still process 0 results. That means it still can't find the package with the specific name. We could test the query manually in the SCCM to test if the name is valid.

    Best Regards,

    Ray


    Please remembers to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, April 16, 2019 12:51 PM
  • but i got that Package name while run below PS against that DP:

    Get-CMDeploymentPackage -DistributionPointName "INPNQ1SVPS006" | export-csv C:\Reports\inpnq.csv -NoTypeInformation 

    Name PackageID
    Global - Windows 2012 Updates 2018-05 CAS007D1


    Shailendra Dev


    Tuesday, April 16, 2019 2:09 PM
  • Hi i want to remove distributed Software Update Package from DPs

    Shailendra Dev

    Tuesday, April 16, 2019 2:10 PM
  • Hello,

    Try to use -DeploymentPackageId with the package ID then check the results.

    Best Regards,

    Ray


    Please remembers to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, April 16, 2019 2:38 PM
  • Hi Ray,

    Below PS worked for me

    Remove-CMContentDistribution -DeploymentPackageId "CAS00675" -DistributionPointName "INPNQ1SVPS006.test-group.com" -force -Verbose

    just wanted to check is there any logs that we can monitor on DP to confirm mentioned Package removed to free DP disk Space, is that will record in distmgr.log ?


    Shailendra Dev

    Tuesday, April 16, 2019 4:43 PM
  • Hello Shailendra Dev,
     
    Sorry for this late reply.
     
    Yes. The delete operation is come from the distribution manager on the site server to the destination DP, so its process and the results are recorded in the distmgr.log. 
     
    Besides, we also could verify the results via the content locations of the application/package, the contentlibraryexplorer, the status message, etc.
     
    Hope my answer could help you and look forward to your feedback.
     
    Best Regards,
    Ray

    Please remembers to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Shailendra Dev Wednesday, April 17, 2019 4:54 AM
    Wednesday, April 17, 2019 3:27 AM
  • thanks a lot Ray.

    can we have PS script to distribute any content to a list of DPs.


    Shailendra Dev

    Wednesday, April 17, 2019 4:55 AM
  • Hello Shailendra Dev,

    Thanks for you mark.

    Of cause we could. Here is the command to distribute application/package/... to DP(s)/DP group.

    Start-CMContentDistribution

    And here is a very good example how to use it in a actual scenario.

    Distribute Packages or Applications in ConfigMgr 2012 SP1 with PowerShell
    https://www.scconfigmgr.com/2013/08/21/distribute-packages-or-applications-in-configmgr-2012-sp1-with-powershell/

     
    Hope my answer could help you and look forward to your feedback.
     
    Best Regards,
    Ray

         

    Please remembers to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, April 17, 2019 7:01 AM