Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - win32_product not valid

Reply
 
Old 05-10-2007   #1 (permalink)
Frank


 
 

win32_product not valid

I am in the process of writing a query for win32_product but the component is
not installed on some of our boxes. I don't have the luxury of adding this
component, is there a another way to gather installed apps on a server via
powershell?

Thanks in advance,



My System SpecsSystem Spec
Old 05-10-2007   #2 (permalink)
Brandon Shell


 
 

Re: win32_product not valid

By component I assume you mean the Win32_Product?

You can query the HKLM\Software Regkey. Unfornutately, its a little over
zealous (Win32_Product only display stuff installed using Windows
Installer... this is everything) on the results, but it may be good enough
for your purposes.

CODE:
================
function Get-InstalledApplications{
Param($server)
$hklm =
[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$server)
$InstalledApps = $hklm.OpenSubKey("Software")
$InstalledApps.GetSubKeyNames()
}
================

"Frank" <Frank@discussions.microsoft.com> wrote in message
news:C3E77008-3FA6-40A3-AE5C-F6DA998211B2@microsoft.com...
>I am in the process of writing a query for win32_product but the component
>is
> not installed on some of our boxes. I don't have the luxury of adding
> this
> component, is there a another way to gather installed apps on a server via
> powershell?
>
> Thanks in advance,
>
>


My System SpecsSystem Spec
Old 05-11-2007   #3 (permalink)
Marcel J. Ortiz [MSFT]


 
 

Re: win32_product not valid

I find that a good substitute is looking at the Uninstall key. It doesn't
show you everything though.

PS HKLM:\> pushd HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
PS HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall>
get-itemproperty * | ft PSChildName, DisplayName

PSChildName DisplayName
----------- -----------
Connection Manager
Microsoft .NET Framework 2.0 SDK (x64) - ENU Microsoft .NET
Framework 2.0 SDK (x64) - ENU
Microsoft Visual Studio 2005 Remote Debugger (x64) - ENU Microsoft Visual
Studio 2005 Remote Debugger (x64) - ENU
{23EA8626-1A8A-453A-ACC4-77CED745849A} Microsoft .NET
Framework 2.0 SDK (x64) - ENU
{5ADF3AE1-035F-4366-A554-27EF55449BBB} Debugging Tools
for Windows 64-bit
{6E8E85E8-CE4B-4FF5-91F7-04999C9FAE6A} Microsoft Visual
C++ 2005 Redistributable (x64)
{751EE164-9F12-4E57-ADB0-02D8F34A10AD} Microsoft SQL
Server Native Client
{75F299F3-8234-47CD-BB40-2994C1B1105E} Microsoft Visual
Studio 2005 64bit Prerequisites (x64) -...
{90120000-002A-0000-1000-0000000FF1CE} Microsoft Office
Office 64-bit Components 2007
{90120000-002A-0409-1000-0000000FF1CE} Microsoft Office
Shared 64-bit MUI (English) 2007
{90120000-0116-0409-1000-0000000FF1CE} Microsoft Office
Shared 64-bit Setup Metadata MUI (Engli...
{AA0AA91C-2C23-452C-B62F-70054E856AB8} Microsoft SQL
Server VSS Writer
{AB33D723-6E62-4D9B-8364-87A3161A3335} Microsoft Visual
Studio 2005 Remote Debugger (x64) - ENU
{B06C23BC-1E66-EF29-71D1-28AAAFE5EABF} ATI Catalyst
Install Manager
{EB7606A2-2AD9-4F6E-8D01-C2CAB864895C} Windows
PowerShell(TM) 1.0 (Microsoft Internal Only)
{F11828DF-776B-9876-1AB6-E61A62B97086} ccc-utility64



"Brandon Shell" <tshell.mask@mk.gmail.com> wrote in message
news:ur7ybi3kHHA.4960@TK2MSFTNGP02.phx.gbl...
> By component I assume you mean the Win32_Product?
>
> You can query the HKLM\Software Regkey. Unfornutately, its a little over
> zealous (Win32_Product only display stuff installed using Windows
> Installer... this is everything) on the results, but it may be good enough
> for your purposes.
>
> CODE:
> ================
> function Get-InstalledApplications{
> Param($server)
> $hklm =
> [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$server)
> $InstalledApps = $hklm.OpenSubKey("Software")
> $InstalledApps.GetSubKeyNames()
> }
> ================
>
> "Frank" <Frank@discussions.microsoft.com> wrote in message
> news:C3E77008-3FA6-40A3-AE5C-F6DA998211B2@microsoft.com...
>>I am in the process of writing a query for win32_product but the component
>>is
>> not installed on some of our boxes. I don't have the luxury of adding
>> this
>> component, is there a another way to gather installed apps on a server
>> via
>> powershell?
>>
>> Thanks in advance,
>>
>>

>


My System SpecsSystem Spec
Old 05-12-2007   #4 (permalink)
Keith Hill [MVP]


 
 

Re: win32_product not valid

"Marcel J. Ortiz [MSFT]" <mosoto@online.microsoft.com> wrote in message
news:OCSfOA%23kHHA.1388@TK2MSFTNGP05.phx.gbl...
>I find that a good substitute is looking at the Uninstall key. It doesn't
>show you everything though.
>
> PS HKLM:\> pushd HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
> PS HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall>
> get-itemproperty * | ft PSChildName, DisplayName


I typically use this approach also because gwmi Win32_Product is
phenomenally slow on most machines that I have tried it on.

--
Keith


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
win32_product in windows 2003 VB Script
Win32_Product InstallDate PowerShell
win32_product uninstall method PowerShell
Get-WmiObject Win32_Product PowerShell
WMI Object Win32_Product and Pipeline woes PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46