...Because someone's gotta tell the story...


To return to the main Blog List, click Full Blog Listing.


System Center

Reporting/Inventory of the SQL Edition in SCCM (Part 3)

Monday, September 21, 2015 in System Center (Views: 2196)
So, I wasn't expecting a "Part 3" to this blog, but the question came up – what about those who can't run PowerShell?

For you few weirdos in the world who don't allow PowerShell scripts to run, here's the VBScript equivalent. Enjoy.

Dim recResults
if isobject(cn) = false then
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.ConnectionString = "Provider=SQLOLEDB.1;Data " & _
"Source=(local); Initial Catalog=master;trusted_connection=yes"
strQuery = "select Serverproperty ('edition')"
set recResults = cn.execute(strQuery)

Select Case True
case Instr(strResult,"Developer") > 0
wscript.echo "Developer"
case Instr(strResult,"Standard") > 0
wscript.echo "Standard"
case Instr(strResult,"Enterprise") > 0
wscript.echo "Enterprise"
Case Else
wscript.echo "No SQL Detected or Installed."
End Select
end if

I dedicate this blog to one said weirdo who requested it, because their company believes (cough) PowerShell is pretty much of the devil, but they allow old scripting. :)


Related Blogs You May Be Interested In:

To leave a comment, please log in and/or register.