I am having trouble how to figure out how to access the items in the programs and features with powershell on server 2003. I currently have a script that will check if a specific application is installed under programs and then execute more commands after that, this is on server 2008.
$checkMSI = (Get-WmiObject -Query ‘SELECT * from win32_product where IdentifyingNumber = “{E876A5DA-9506-4F94-A304-E032CB53E970}”’).IdentifyingNumber
unfortunately the class “win32_product” is not available in server 2003.
Ok, thank you very much. In my environment I have alot of servers that are in facilities out of state so I dont have immediate access to them to go ahead and install this addition to them, do you know of any other way to access the control panel in 2003? Or is this by far the easiest route.
All of the information that you need to reproduce Win32_Product’s behavior (without the annoying side effects) can be found in the registry, mostly under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\ . This covers software that was installed with a Windows Installer package. Other, non MSI-based software can be found under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ . (There are some entries under the Uninstall key for MSI-based packages as well, but not with nearly as much detail as you’ll find under the Installer key.)
Maybe this function will help. It parses the registry keys Dave mentioned. function Get-InstalledProgram{
<#
.SYNOPSIS
Gets the installed programs.
.DESCRIPTION
This function queiries the registry for installed programs.
.PARAMETER DisplayName
Optional filter. Name of the program. Suports wild cards.
.PARAMETER Publisher
Optional filter. Name of the appliication vendor. Supports wild cards.
.EXAMPLE
Get-InstalledPrograms
.EXAMPLE
Get-InstalledPrograms -Publisher VMware*
.EXAMPLE
Get-InstalledPrograms | Out-GridView
.INPUTS
System.String,System.String
.OUTPUTS
PSOBject
.NOTES
Created on: 8/10/2013 8:32 PM
Created by: David Christian
.LINK
opscripting.com