Solved

VBScript to return WMI value on SMS Server

Posted on 2006-11-13
4
723 Views
Last Modified: 2012-06-27
I've been using WBEMTEST to find the values under SMS_CONFIGURATIONITEM

Select * from SMS_CONFIGURATIONITEM

This then shows a list of items like this:

SMS_ConfigurationItem.CI_ID=1
SMS_ConfigurationItem.CI_ID=2
SMS_ConfigurationItem.CI_ID=3
SMS_ConfigurationItem.CI_ID=4

I want to do this via VBScript, showing the data contained within each "SMS_ConfigurationItem.CI_ID=#"

Can you help?

Thank you!

JohnD
0
Comment
Question by:johndarby
  • 3
4 Comments
 
LVL 1

Author Comment

by:johndarby
ID: 17934870
I tried this, but it failed, saying "object doesn't support this property or method" regarding objItem.Name

Here is what I have thus far...


strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\sms\site_b02")

Set colItems = objWMIService.ExecQuery("Select * from SMS_ConfigurationItem")

For Each objItem In colItems
    Wscript.Echo "Name: " & objItem.Name
Next
0
 
LVL 12

Accepted Solution

by:
jkaios earned 500 total points
ID: 17935225
Is there any namespace or WMI class called SMS_CONFIGURATIONITEM ??

As far as I know, there is an SMS_SCI_Configuration class, is that what you're after?

Or there is another one: SMS_SIIB_Configuration.
0
 
LVL 1

Author Comment

by:johndarby
ID: 17940140
This is SMS 2007 and the featureset is DCM (desired configuration management). The SMS_CONFIGURATIONITEM is provided for WMI via SMS server and is actually the data that resides in the SMS DB "dbo.CI_LocalizedCategoryInstances" Table.

This question is the WMI equivalent of the SQL question you answered for me yesterday.
0
 
LVL 1

Author Comment

by:johndarby
ID: 17940170
Your answer there:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_22059383.html

...is the one I was looking for here.

Thanks!
JohnD
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now