QuickTricks: Bulk delete Management Packs in OpsMgr 2012 by date added

Are you looking for a way to quickly remove all management packs that you added on a specific day? The following is what we put together to remove all of the management packs loaded on a specific day.

 

The first PowerShell script lists all management packs which were added on a specific day (7/18/2014 in this case):

Get-SCOMManagementPack
|
where {$_.TimeCreated –like
“*7/18/2014*” }

The second PowerShell script takes the list of management packs added on that day and removes them.

Get-SCOMManagementPack
|
where {$_.TimeCreated –like
“*7/18/2014*” } |
Remove-SCManagementPack

 

The above scripts will need to be changed from the 7/18/2014 date to the date that you would want them removed from of course and do not use this in a production environment without fully testing this as this command done incorrectly could remove all management packs from the environment.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.