Managed SMS Provider Fundamentals in Configuration Manager
The managed SMS Provider library is a .NET Framework library that wraps the System.Management classes and provides a Configuration Manager-centric object model. It also provides a wrapper for accessing the Configuration Manager site control file.
The library can be used outside of any code relating to the Configuration Manager console .NET Framework library, but is built on the same underlying architecture.
For information about using managed code with the Configuration Manager client, see About Configuration Manager WMI Programming.
Configuration Manager Classes and Interfaces
The primary classes and interfaces for use with the managed SMS Provider are the following:
WqlConnectionManager
The class WqlConnectionManager
provides access to the Configuration Manager Windows Management Instrumentation (WMI) provider.
It is an implementation of the abstract base class ConnectionManagerBase that defines connections throughout the managed Configuration Manager libraries.
It is used to connect to the SMS Provider and query, or create, Configuration Manager object instances. The following tasks demonstrate the basic usage of WqlConnectionManager.
How to Connect to a Configuration Manager Provider using Managed Code.
How to Read a Configuration Manager Object Using Managed Code.
How to Perform an Asynchronous Configuration Manager Query Using Managed Code
IResultObject
IResultObject is an interface that all result sets and objects expose. Through it, you can read, modify, delete, call methods on, and otherwise manipulate Configuration Manager objects. You typically get an IResultObject
whenever you create an object or as a result of a query.
The following tasks demonstrate the basic use of IResultObject
:
How to Modify a Configuration Manager Object Using Managed Code
How to Delete a Configuration Manager Object Using Managed Code
How to Call a Configuration Manager Object Method Using Managed Code
QueryProcessor
QueryProcesor provides support for both synchronous and asynchronous queries against the SMS Provider. In asynchronous queries, SmsBackgroundWorker is used to provide thread support query results. The following tasks demonstrate queries:
How to Perform an Asynchronous Configuration Manager Query Using Managed Code.
How to Perform a Synchronous Configuration Manager Query Using Managed Code.
IQueryPropertyItem
IQueryPropertyItem is a single property of the result object, supports data binding and get/set properties.
The following tasks demonstrate the use of IQueryPropertyItem
:
How to Modify a Configuration Manager Object Using Managed Code.
Assemblies
The assemblies that are required for using managed SMS Provider are:
microsoft.configurationmanagement.managementprovider
adminui.wqlqueryengine
The WMI implementation of the managed Configuration Manager libraries is provided by adminui.wqlqueryengine.