Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Installed Software Inventory

HTVi
TV Discussion Newsgroups

Installed Software Inventory
Alejandro AM 6/29/2007 11:00:01 PM
I can use successfully a script for enumerate the installed software in a
Windows XP based computer, but if I try to use the same script in a Windows
2003 Server, the script does not work.

In the XP Computer, the WMI Class Win32_Product exists, but do not exist in
Windows Server 2003

How can I enumerate the installed software on a Windows Server

Thanks for all your support
--
Alejandro AM
RE: Installed Software Inventory
John King 6/30/2007 5:06:01 PM
Alejandro, can you send me the original script that works for you on the xp
computer

Thanks

John

"Alejandro AM" wrote:

[Quoted Text]
> I can use successfully a script for enumerate the installed software in a
> Windows XP based computer, but if I try to use the same script in a Windows
> 2003 Server, the script does not work.
>
> In the XP Computer, the WMI Class Win32_Product exists, but do not exist in
> Windows Server 2003
>
> How can I enumerate the installed software on a Windows Server
>
> Thanks for all your support
> --
> Alejandro AM
RE: Installed Software Inventory
Alejandro AM 7/3/2007 2:06:03 PM
On Error Resume Next

strComputer = "."
Const ForWriting = 2
Const ForAppending = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.CreateTextFile("C:\HP\software.csv", _
ForWriting, True)

objLogFile.Write chr(34) & "Description" & chr(34) & ","
objLogFile.Write chr(34) & "Identifying Number" & chr(34) & ","
objLogFile.Write chr(34) & "Installation Date" & chr(34) & ","
objLogFile.Write chr(34) & "Installation Location" & chr(34) & ","
objLogFile.Write chr(34) & "Installation State" & chr(34) & ","
objLogFile.Write chr(34) & "Name" & chr(34) & ","
objLogFile.Write chr(34) & "Package Cache" & chr(34) & ","
objLogFile.Write chr(34) & "SKU Number" & chr(34) & ","
objLogFile.Write chr(34) & "Vendor" & chr(34) & ","
objLogFile.Write chr(34) & "Version" & chr(34)
objLogFile.Writeline


Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
For Each objSoftware in colSoftware
objLogFile.Write chr(34) & objSoftware.Description & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.IdentifyingNumber & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.InstallDate2 & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.InstallLocation & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.InstallState & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.Name & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.PackageCache & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.SKUNumber & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.Vendor & chr(34) & ","
objLogFile.Write chr(34) & objSoftware.Version & chr(34) & ","
objLogFile.Writeline
Next

Wscript.Echo "Done!"
--
Alejandro AM


"John King" wrote:

[Quoted Text]
> Alejandro, can you send me the original script that works for you on the xp
> computer
>
> Thanks
>
> John
>
> "Alejandro AM" wrote:
>
> > I can use successfully a script for enumerate the installed software in a
> > Windows XP based computer, but if I try to use the same script in a Windows
> > 2003 Server, the script does not work.
> >
> > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in
> > Windows Server 2003
> >
> > How can I enumerate the installed software on a Windows Server
> >
> > Thanks for all your support
> > --
> > Alejandro AM
RE: Installed Software Inventory
John King 7/3/2007 2:40:01 PM
Thanks Alejandro !!

"Alejandro AM" wrote:

[Quoted Text]
> On Error Resume Next
>
> strComputer = "."
> Const ForWriting = 2
> Const ForAppending = 2
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objLogFile = objFSO.CreateTextFile("C:\HP\software.csv", _
> ForWriting, True)
>
> objLogFile.Write chr(34) & "Description" & chr(34) & ","
> objLogFile.Write chr(34) & "Identifying Number" & chr(34) & ","
> objLogFile.Write chr(34) & "Installation Date" & chr(34) & ","
> objLogFile.Write chr(34) & "Installation Location" & chr(34) & ","
> objLogFile.Write chr(34) & "Installation State" & chr(34) & ","
> objLogFile.Write chr(34) & "Name" & chr(34) & ","
> objLogFile.Write chr(34) & "Package Cache" & chr(34) & ","
> objLogFile.Write chr(34) & "SKU Number" & chr(34) & ","
> objLogFile.Write chr(34) & "Vendor" & chr(34) & ","
> objLogFile.Write chr(34) & "Version" & chr(34)
> objLogFile.Writeline
>
>
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colSoftware = objWMIService.ExecQuery _
> ("Select * from Win32_Product")
> For Each objSoftware in colSoftware
> objLogFile.Write chr(34) & objSoftware.Description & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.IdentifyingNumber & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.InstallDate2 & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.InstallLocation & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.InstallState & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.Name & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.PackageCache & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.SKUNumber & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.Vendor & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.Version & chr(34) & ","
> objLogFile.Writeline
> Next
>
> Wscript.Echo "Done!"
> --
> Alejandro AM
>
>
> "John King" wrote:
>
> > Alejandro, can you send me the original script that works for you on the xp
> > computer
> >
> > Thanks
> >
> > John
> >
> > "Alejandro AM" wrote:
> >
> > > I can use successfully a script for enumerate the installed software in a
> > > Windows XP based computer, but if I try to use the same script in a Windows
> > > 2003 Server, the script does not work.
> > >
> > > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in
> > > Windows Server 2003
> > >
> > > How can I enumerate the installed software on a Windows Server
> > >
> > > Thanks for all your support
> > > --
> > > Alejandro AM
RE: Installed Software Inventory
John King 7/3/2007 3:06:03 PM
Hi Alejandro, one more question, if my system has more than one drive or is
partitoned and some of my software is installed into the partition, how can I
modify the script to "detect" those installations or software locations ? I
ran your script successfully but it only came back with the software packages
installed on the c drive.

Thanks again

John

"Alejandro AM" wrote:

[Quoted Text]
> On Error Resume Next
>
> strComputer = "."
> Const ForWriting = 2
> Const ForAppending = 2
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objLogFile = objFSO.CreateTextFile("C:\HP\software.csv", _
> ForWriting, True)
>
> objLogFile.Write chr(34) & "Description" & chr(34) & ","
> objLogFile.Write chr(34) & "Identifying Number" & chr(34) & ","
> objLogFile.Write chr(34) & "Installation Date" & chr(34) & ","
> objLogFile.Write chr(34) & "Installation Location" & chr(34) & ","
> objLogFile.Write chr(34) & "Installation State" & chr(34) & ","
> objLogFile.Write chr(34) & "Name" & chr(34) & ","
> objLogFile.Write chr(34) & "Package Cache" & chr(34) & ","
> objLogFile.Write chr(34) & "SKU Number" & chr(34) & ","
> objLogFile.Write chr(34) & "Vendor" & chr(34) & ","
> objLogFile.Write chr(34) & "Version" & chr(34)
> objLogFile.Writeline
>
>
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colSoftware = objWMIService.ExecQuery _
> ("Select * from Win32_Product")
> For Each objSoftware in colSoftware
> objLogFile.Write chr(34) & objSoftware.Description & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.IdentifyingNumber & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.InstallDate2 & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.InstallLocation & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.InstallState & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.Name & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.PackageCache & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.SKUNumber & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.Vendor & chr(34) & ","
> objLogFile.Write chr(34) & objSoftware.Version & chr(34) & ","
> objLogFile.Writeline
> Next
>
> Wscript.Echo "Done!"
> --
> Alejandro AM
>
>
> "John King" wrote:
>
> > Alejandro, can you send me the original script that works for you on the xp
> > computer
> >
> > Thanks
> >
> > John
> >
> > "Alejandro AM" wrote:
> >
> > > I can use successfully a script for enumerate the installed software in a
> > > Windows XP based computer, but if I try to use the same script in a Windows
> > > 2003 Server, the script does not work.
> > >
> > > In the XP Computer, the WMI Class Win32_Product exists, but do not exist in
> > > Windows Server 2003
> > >
> > > How can I enumerate the installed software on a Windows Server
> > >
> > > Thanks for all your support
> > > --
> > > Alejandro AM

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen