Using WMI to retrieve info on SQL

(imported topic written by r.kelly)

Does anyone have the code handy for using BF to query WMI for SQL to get:

Instances Names

Database Names

Size of Databases

?

Or if there is a smarter way of doing this, I’m all ears :slight_smile:

(imported comment written by SystemAdmin)

Great suggestion… I did something like this when building some SCM security check fixlets. I’ve ripped out the basic run-a-MSSQL-command part and put it into a separate task.

You can download it here:

http://bigfix.me/cdb/fixlet/640

The link leads to a database (

http://bigfix.me/cdb

) I’ve put together to help developers and admins get the most advantage from BigFix.

Use this database to search through hundreds of relevance statements, fixlets, and analyses.

Many are not officially published since many are part of my side-projects that I wanted to share with everyone.