Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Get SQL Server client version on remote server using VBScript

Reply
Thread Tools Display Modes

Get SQL Server client version on remote server using VBScript

 
 
Highlander
Guest
Posts: n/a

 
      04-13-2011
Hello.

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
 
Reply With Quote
 
 
 
 
Mayayana
Guest
Posts: n/a

 
      04-13-2011
The download here details the pros and cons of different
methods of getting installed software. Sample scripts
are included:

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.)

|
| 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


 
Reply With Quote
 
Highlander
Guest
Posts: n/a

 
      04-13-2011
On Apr 13, 10:26*am, "Mayayana" <mayay...@invalid.nospam> wrote:
> The download here details the pros and cons of different
> methods of getting installed software. Sample scripts
> are included:
>
> 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
 
Reply With Quote
 
Mayayana
Guest
Posts: n/a

 
      04-13-2011
> Mayayana - thanks for the reply. I cannot use your script however.

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.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WLM 2011 Problems..back to 2010? Panic Windows Live Mail 17 01-01-2011 03:25 AM
sbs 2003 network slow why? john Windows Small Business Server 9 04-03-2010 11:10 PM
Re: Active Directory problems/dcdiag error kj [SBS MVP] Windows Server 4 03-24-2010 09:19 PM
Re: Disable Windows Firewall Lanwench [MVP - Exchange] Windows Small Business Server 7 01-06-2010 11:45 PM
No MEDIA CENTERE with VISTA REINSTALL adamfez Windows Vista Installation 4 08-20-2007 01:50 PM



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 47 48 49 50 51 52 53 54 55 56 57 58 59