to uninstall a software, from for example a core server, using powershell you may use these script snipplets I found today having the need to uninstall a program rom a non GUI server.
At first you may want to list all installed programs:
Get-WmiObject -Class Win32_Product
Look for the software to uninstall in that list and copy a significant part of the “Name” to clipboard.
(i was looking to uninstall the “MS VMM DHCP Server (x64)” stuff, so I entered the following line to filter just for that:
Get-WmiObject -Class Win32_Product -Filter „Name like ‚%DHCP Server%'“
and then added the uninstall routine to the command to finallize the removal of the software:
Get-WmiObject -Class Win32_Product -Filter „Name like ‚%Microsoft System Center Virtual Machine Manager DHCP Server (x64)%'“ | ForEach-Object { $_.Uninstall()}
Finally you may want to check that the software is really not listed anymore using:
Get-WmiObject -Class Win32_Product
Torsten
Please try to avoid using Win32_Product! See http://gregramsey.net/2012/02/20/win32_product-is-evil/ for details!
Oliver Sommer
Well Thorsten, I would, if there’d be any other somehow easy way to uninstall programs from a core server…
Thorsten
Hi Oliver
Sorry for my small comment. The quotation marks must be in a upper Position. Than the Powershell commands will be working perfect.
regards Thorsten