Solved

VBScript to return WMI value on SMS Server

Posted on 2006-11-13
4
725 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

785 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