I've got a few hundred Windows servers to check for which version of
SQL Server client is installed. They have SQL Server client version
2005, 2008, or both. I typically use a VBScript to check servers
remotely for installed versions of programs, usually using the
registry.
I've done some checking and found out that I cannot use the registry
to check for SQL, due to inconsistencies; and that using WMI is the
preferred method.
I've searched high and low and cannot find a WMI script which does
this. Does anyone have a VBScript that uses WMI to get the SQL Server
client version on a remote server?
Any help would be greatly appreciated. Thanks!
- Dave
http://www.jsware.net/jsware/scripts.php5#enumsoft
I don't deal with remote PCs at all, but there is a WMI
script in the download. You should be able to adapt that.
(This assumes that SQL Server installs via MSI file. WMI
cannot return installed software info. per se. It only sees
MSI-installed software.)
Mayayana - thanks for the reply. I cannot use your script however.
Anyone else?
- Dave
Sorry, I was thinking of the Windows Installer code.
I didn't realize that I hadn't actually included a WMI
script. (WMI wraps Windows Installer, so for someone
not dealing with a network WMI is irrelevant.)
I think you can use the following. Again, I'm not
familiar with remote operations, but I think you
just have to change the GetObject parameter.
Dim WMI, Col, Prod
Set WMI = GetObject("WinMgmts:")
Set Col = WMI.InstancesOf("Win32_Product")
For Each Prod in Col
MsgBox Prod.name & vbCrLf & Prod.vendor & vbCrLf & Prod.version
Next
Set Col = Nothing
Set WMI = Nothing
Alternatively, you can set up a query:
Dim WMI, Col, Prod
Set WMI = GetObject("WinMgmts:")
Set Col = WMI.ExecQuery("Select * FROM Win32_Product WHERE Vendor =
'Microsoft Corporation'")
For Each Prod in Col
MsgBox Prod.name & vbCrLf & Prod.vendor & vbCrLf & Prod.version
Next
Set Col = Nothing
Set WMI = Nothing
See Win32_Product for more details about its properties.