StevensNet.com

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

Blogs

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

Tags

PowerShell
SCCM
SQL
System Center
VBScript

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

Monday, September 21, 2015 in System Center (Views: 1487)
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"
cn.Open
strQuery = "select Serverproperty ('edition')"
set recResults = cn.execute(strQuery)
recResults.MoveFirst
strResult=recResults("")

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.