Enumerate installed software on Windows 2003



Using this scriptomatic script, I am able to list all installed
software on our Windows 2000 servers, but the script fails to run on
our Windows 2003 servers. It fails on the line "For Each objItem In
colItems", as colItems is empty. Can anyone tell me why this might be
happening? Win32_Product is supposed to work for Windows 2003 also.
FYI, I did confirm the default impersonation level is still set at 3 in
the registry on the servers. Suggestions???


----------------

On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("PCNAME")
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_Product", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "Description: " & objItem.Description
WScript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
WScript.Echo "InstallDate: " & objItem.InstallDate
WScript.Echo "InstallDate2: " &
WMIDateStringToDate(objItem.InstallDate2)
WScript.Echo "InstallLocation: " & objItem.InstallLocation
WScript.Echo "InstallState: " & objItem.InstallState
WScript.Echo "Name: " & objItem.Name
WScript.Echo "PackageCache: " & objItem.PackageCache
WScript.Echo "SKUNumber: " & objItem.SKUNumber
WScript.Echo "Vendor: " & objItem.Vendor
WScript.Echo "Version: " & objItem.Version
WScript.Echo
Next
Next


Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" &
Mid(dtmDate,13, 2))
End Function

.



Relevant Pages

  • Re: Shutdown Script
    ... requested a shutdown script for all our servers in the datacenter. ... course a simple tool for our Windows Servers was found and utilized, ...
    (comp.unix.questions)
  • Re: Local User Accounts
    ... of servers: ... I'm running the script from a Windows 2000 Advanced Serverand it will get ... When I test the script from my laptop running Windows XP, ...
    (microsoft.public.windows.server.scripting)
  • Re: Ok to let all ICMP traffic through firewall?
    ... If you want to know, what "Shutdown Windows' servers" does exactly, you ... The program does just the same as Torsten's script in version 2.1, ...
    (comp.security.firewalls)
  • Windows 2003 Removable Storage NTBackup Troubles
    ... We are in the process of upgrading all those servers to Windows 2003, ... With Windows NT and Windows 2000, we used a script to automate the ... problem at this point) the tape device disables itself in the removable ...
    (microsoft.public.windows.server.general)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.misc)