I recently had the need to uninstall a ManagementPack from OpsMgr without using the Operators Console (kept getting a exception error every time I opened the console after importing the eXcSoftware Management Pack). Here’s how I did it:
- On the RMS, open Command Shell.
- You’ll need to know the name of the MP, so at the powershell prompt type Get-ManagementPack. If [like me] you have a large number of MP’s installed, you’ll probably want to pipe this into a text file, or expand the Screen Buffer Size to something like 3000, run the command and then [right click and select find to] search.
- Once you have the name we can now uninstall the MP. Start by typing the following:
$MP = Get-ManagementPack :where-object {$_.Name -eq ‘eXcSoftware.nonWindows’
We’ve now set the variable $MP to contain the values for the MP. Now type in:
uninstall-managementpack -managementpack $mps
- Sadly, there is no confirmation that the MP has been uninstalled. You’ll have to go into the console to confirm.
Powershell (and the Command Shell) adds a whole new set of functionality to OpsMgr and allows for data mining and scripting that is otherwise unavailable. You can install the OpsMgr command shell on your desktop by running setup.exe from the install media.
Read the complete post at http://www.1e.com/techblog/post/2009/07/07/Uninstalling-a-Management-Pack-using-Powershell.aspx