![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VBScript + WMI + SQL Server = troubles Hello, I'am trying to read some performance counters from MSSQL 2008 using vbscript via WMI (to be strict, what I need is number of logins to the server). Normally (I mean, just like for any other windows performance counter) you would use something like: ---code start--------------- Set objLocator = CreateObject("WbemScripting.SwbemLocator") Set objWMIService = objLocator.ConnectServer("", "root\cimv2") sQry = "Select * from " & _ "Win32_PerfFormattedData_MSSQLSERVER_SQLServerGeneralStatistics" Set colItems = objWMIService.ExecQuery(sQry,"WQL",48) For Each objItem in colItems wscript.echo "SQL, UserConnections : " & objItem.UserConnections Next ---code start--------------- Unfortunately it returns always 0.What is more, running following: |Get-WmiObject -Class | Win32_PerfFormattedData_MSSQLSERVER_SQLServerGeneralStatistics from PowerShell returns zeros as well. But the same counter choosen in perfmon shows proper value. Both OS and SQL server are 32 bit. What am I doing wrong? Regards -- Wojtek Piszczek |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VBscript in 2008 Server Task Scheduler will not run | VB Script | |||
| VBScript to send email not working on 1 server | VB Script | |||
| VBScript to send email not working on 1 server | VB Script | |||
| Vista & Home Network Web Server Troubles | Vista General | |||
| Media Server Troubles | Vista networking & sharing | |||