Server. Management. Dmf
The Microsoft.SqlServer.Management.Dmf namespace contains classes that represent the SQL Server policy-based management objects.
The Condition object represents a policy-based management condition.
The ConditionExtender class is an exception that is raised when the expression tree is incorrect.
The ConnectionEvaluationHistory object represents information about parent policy evaluation that is stored in the system catalogs.
The ConnectionEvaluationHistoryCollection class represents a collection of ConnectionEvaluationHistory objects that represent all the connection evaluation histories that are in the evaluation history.
The EvaluationDetail object represents the evaluation information that is stored in the system catalogs about the parent policy for a given target.
Represents the evaluation factory in policy-based management services.
The EvaluationHistory object represents information about parent policy evaluation that is stored in the system catalogs.
The ExpressionNode object represents a policy-based management expression node. The expression node describes part of an expression, such as a constant value, an operator, or a function.
The ExpressionNodeAttribute object represents an attribute of a policy-based management expression node.
The ExpressionNodeChildren object represents the child expression nodes that are dependent on an expression node.
The ExpressionNodeConstant object represents an constant value that is used in an expression.
The ExpressionNodeFunction object represents part of a policy-based management expression that is a function.
The ExpressionNodeGroup object represents an expression node that is a group.
The ExpressionNodeOperator object represents an expression node that is an operator.
The FacetInfo object represents facet information. A facet represents a logical dimension of a target object and is used, together with a local expression, to build a condition.
The ObjectSet object represents a policy-based management set of objects.
The Policy object represents a Policy-Based Management policy. A policy represents the relationship between a target object and a condition.
Represents the arguments that are passed to the event handler when the connection processing is finished.
Represents the arguments that are passed to the event handler when the connection processing has started.
Represents the arguments that are passed to the event handler when the evaluation of a policy finishes.
Represents the arguments that are passed to the event handler when the target is processed.
Represents a category that classifies policies in SQL Server Policy-Based Management. Policy Categories are used to group policies together to which target objects can subscribe.
Contains information about the policy category in policy-based management services.
The PolicyCategorySubscription object represents a subscription to a particular policy category.
Represents the XML writer that records the policy evaluation history in Policy-Based Management.
Represents a wrapper class for the policy evaluation.
Contains additional functionality for the Policy object.
The PolicyStore type is the root of the DMF object model.
Represents a policy store upgrade session.
Represents the target evaluation in policy-based management services.
Represents the target set level in policy-based management services.
Represents a utility class that is used in policy-based management services.
The AdHocPolicyEvaluationMode enumeration contains values that specify the method that is used to evaluate the policy.
The ExpressionNodeFunction.Function enumeration contains values that represent the different types of supported functions.
The ExpressionNodeType enumeration contains values that specify the type of expression node.
The NameConditionType enumeration contains values that are used to specify the condition that is used in a policy.
Specifies the type of operator.
The PolicyHealthState enumeration contains values that specify the health state of the policy.
Specifies the enumeration mode for the PolicyStore object.
The TypeClass enumeration contains values that describe the different class types.
The Policy.ConnectionProcessingFinishedEventHandler class represents the event handler that handles the event that occurs when the processing of the connection has finished.
The Policy.ConnectionProcessingStartedEventHandler class represents the event handler that handles the event that occurs when the processing of a connection has started.
Represents the arguments that are passed to the event handler when a policy evaluation finishes.
The Policy.PolicyEvaluationStartedEventHandler class represents the event handler that handles the event that occurs when the evaluation of a policy has started.
The Policy.TargetProcessedEventHandler class represents the event handler that handles the event that occurs when the target has been processed.
The top-level instance is the PolicyStore class, which proves the connection to the instance of SQL Server.
The DMF objects can be used to create and manage policies that control the behavior and configuration of an instance of SQL Server. All behavior and configurations are represented by facets. The Microsoft.SqlServer.Management.Facets namespace contains the objects that represent the repository of facets used when defining policies. Policies are used when defining a DAC package using the DAC objects. This enables you control policies when installing a database application structure stored in the DAC package onto an instance of SQL Server. The specified policies determine the instances of SQL Server in the SQL Fabric to which the DAC package can be deployed.
A policy is the result of applying a condition to one of more target object. The condition is a facet combined with a state of behavior, for example, Database Mail is the facet and whether it is installed or not is the state. So, specifying that Database Mail must be installed is a condition. You can create a target set of objects by applying a filter. Then, apply the condition to the target object set to make a policy.
The Microsoft.SqlServer.Management.Dmf namespace resides in the Microsoft.SqlServer.Dmf.dll file. Additionally, some supporting objects are in the Microsoft.SqlServer.DmfSqlClrWrapper.dll and Microsoft.SqlServer.Dmf.Adapters.dll files. You will have to import these files to access the classes in the Microsoft.SqlServer.Management.Dmf namespace.
By using the Microsoft.SqlServer.Management.Dmf namespace, you can do the following:
Create, read, update and delete policies, target objects, conditions, filters and subscriptions.
Script out the DMF objects associated with the connection.
Define a target object set by using a filter.
Extract the existing configuration state from an instance of SQL Server and create a policy.
Export and import DMF objects.
Assign a policy to a set of target objects.
Evaluate a policy.
Have target subscribe to policy.