Hi guys,
Has anyone here used the Win32_product class to list installed software from remote computers or used its methods like Uninstall() ?
It seems that Microsoft advises against using this class:
http://support.microsoft.com/kb/974524
I found some alternatives here:
http://blogs.technet.com/b/heyscrip...shell-to-quickly-find-installed-software.aspx
problem with the alternatives:
1. Win32Reg_AddRemovePrograms is available only if the SMS/SCCM client is installed and get-member does not list any methods just properties so you could not initiate an uninstall
2. The registry query should run on any computer and it's fine if all you need is to list the software but then you run into the same problem: no methods to call upon
Anyway this is a heads up for anyone using this class.
Also do you guys have any ideas on an alternative to something like:
aside from a remote execution of the uninstall file with a silent switch of course
any .net objects ( that I can build in powershell) perhaps that have this function?
Has anyone here used the Win32_product class to list installed software from remote computers or used its methods like Uninstall() ?
It seems that Microsoft advises against using this class:
http://support.microsoft.com/kb/974524
Win32_product Class is not query optimized. Queries such as select * from Win32_Product where (name like 'Sniffer%') require WMI to use the MSI provider to enumerate all of the installed products and then parse the full list sequentially to handle the where clause. This process also initiates a consistency check of packages installed, verifying and repairing the install. With an account with only user privileges, as the user account may not have access to quite a few locations, may cause delay in application launch and an event 11708 stating an installation failure.
I found some alternatives here:
http://blogs.technet.com/b/heyscrip...shell-to-quickly-find-installed-software.aspx
problem with the alternatives:
1. Win32Reg_AddRemovePrograms is available only if the SMS/SCCM client is installed and get-member does not list any methods just properties so you could not initiate an uninstall
2. The registry query should run on any computer and it's fine if all you need is to list the software but then you run into the same problem: no methods to call upon
Anyway this is a heads up for anyone using this class.
Also do you guys have any ideas on an alternative to something like:
Code:
$a = get-wmiobject win32_product -computer yyyy | where-object {$_.name -like "*XXXX*"}
$a.Uninstall()
aside from a remote execution of the uninstall file with a silent switch of course
any .net objects ( that I can build in powershell) perhaps that have this function?
Last edited: