Export (0) Print
Expand All

Operations Manager Data Queries Overview

System Center

Updated: January 31, 2012

Applies To: System Center 2012 - Operations Manager

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

The Operations Manager class libraries provide classes to encapsulate data for Operations Manager components and methods for accessing the data from a software development kit (SDK) client.

Filtering Data

All methods that retrieve Operations Manager data accept a criteria object as an argument. Criteria objects use a string expression to filter the results that are returned by the method.

The following code sample illustrates how to retrieve management packs whose Name property equals Microsoft.Windows.Server.2003.Computer:


ManagementGroup mg = new ManagementGroup("localhost");
ManagementPackCriteria mpCriteria = new ManagementPackCriteria("Name='Microsoft.Windows.Server.2003.Computer'");
IList<ManagementPack> list = mg.ManagementPacks.GetManagementPacks(mpCriteria);


Getting Valid Properties for Use in Criteria Expressions

The properties that you can use in the criteria expression vary, depending on the type of objects that are returned by the method. In the previous example, the expression used the management pack's Name property to filter the results. Other management pack properties that could have been used include Id, Sealed, Version, LastModified, and TimeCreated (among others).

You can obtain a list of the valid properties for any criteria type by using the GetValidPropertyNames method. For example, to obtain a collection of valid property names for use in defining a criteria expression, you could use the following method:

ReadOnlyCollection<string> validProperties = ManagementPackCriteria.GetValidPropertyNames(); 

If a criteria expression is not valid, the System Center Data Access service throws an Microsoft.EnterpriseManagement.Common. InvalidCriteriaException, which you can catch in your SDK client to revise the expression.

For information about the operators you can use in criteria expressions, see Criteria Expression Syntax.

Examples

See Also

 

Community Additions

ADD
Show:
© 2015 Microsoft