Using PowerCLI to Uninstall vCenter Extensions

After finishing a CapacityIQ evaluation we wanted to uninstall the plug-in from vCenter. VMware KB article 1025360 shows how to do this, but it requires the Managed Object Browser. Per the security hardening guide we disabled the mob so this solution would not work as given. PowerCLI to the rescue.

Here are the steps given in the original article and how they translate into PowerCLI.

#1.In a web browser, navigate to http://<vcenter server name or IP>/mob.
#Where <vcenter server name or IP> is the name of your vCenter Server or its IP address.
Connect-VIServer vcenter001
 
#2.Click Content. 
#3.Click ExtensionManager. 
$em = Get-View ExtensionManager
 
#4.Select and copy the name of the plug-in you want to remove from the list of values under Properties. 
$em.ExtensionList | ft -Property Key
 
#5.Click UnregisterExtension. A new window appears. 
#6.Paste the name of the plug-in and click Invoke Method. This removes the plug-in.
$em.UnregisterExtension("extension key name")
 
#7.Close the window. 
#8.Refresh the Managed Object Type:ManagedObjectReference:ExtensionManager window to verify if the plug-in is removed successfully.
# Note that we need to refresh the data before listing the plugins
$em.UpdateViewData()
$em.ExtensionList | ft -Property Key
 
# Log out
Disconnect-VIServer

Comments (2)

  1. Jay Esparza

    Are you sure? 😉 – Yeah I have no idea what you’re talking about .. but it looks interesting.

  2. Anonymous

    This worked perfectly as you described–thanks for writing it up.

    Mark

Leave a Comment

Your email address will not be published.