Wednesday, February 22, 2012

Uninstalling the SCVMM Agent from Server Core

Okay, I admit it, I screwed up.

In testing the various releases of SCVMM 2012 I dorked up my environment.  I tossed away my database when moving between builds. 

And then when I wen to re-add my Hyper-V Servers I got an error that an unsupported version of the agent is installed.

Okay, fine - I thought.  I will simply uninstall it.  Um..  But this is Server Core I am using.  There is no Control Panel, Uninstall a program.

This article is more about doing something on Server Core than fixing my SCVMM 2012 situation.

Okay.  Well, um.  Regedit works on Server Core.  Okay fire that up.  But I don’t want to manually clean the registry, there must be something useful there though.  And a bit of searching pointed me where I need to be:

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall

This is where all the good programs go that use Windows Installer.

Under here I found the Virtual Machine Manager Agent.  And under that I found a very useful Registry Key:  “UninstallString

The UninstallString key is a string value.  It is the command line option that is invoked when uninstall is performed.  How super handy (I think I might use this all the time).

At your command prompt, run the string you find there and you will be ready to finish repair.

5 comments:

PH said...

Thanks!
Simple, obvious, effective.

CASADEDOLOR said...

Worked great! Thanks

Anonymous said...

thx helped me a lot! also works on Hyper-V Server Machines!

Ian Yates said...

Brilliant. Take a gold star out of petty cash!

BrianEh said...

Using PowerShell there are a couple ways the do this.

1) Get-ChildItem -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
or
2) Get-WmiObject -Class Win32_Product

You would expect to find the same in both places, but hat is not always the case. You will generally find more under the registry key path than under Win32_Product in WMI.
It is a way to hide applications from Add / Remove Programs.