4 Replies Latest reply on Jun 9, 2011 7:58 PM by Adam Bowen

    How to use custom class properties in compliance rules

      I am trying to utilize custom properties within a compliance rule definition and I am encountering an "Unexpected exception while handling" error that references the ComplianceRuleService_verifyComponent object.

       

      I have created the following custom subclasses: Class://SystemObject/Application/SQLServer. Within the SQLServer subclass I have create one custom property called DEFAULT_DATA. This property is a simple string with a default value that is a path (C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data) and it is editable. I have also created an instance of the SQLServer class called SQL.

       

      Within my component template, I have created a local property called SQLDATA with a property class type (SQLServer) and a default value set to the instance defined above (SQL). This property is also editable.

       

      When creating compliance rules, I am able to browse for and define this property from the Component Properties node in the following format:

      ??SQLDATA.DEFAULT_DATA??.

       

      The rule I am using to test this property is:

      ??SQLDATA.DEFAULT_DATA?? equals ??SQLDATA.DEFAULT_DATA?? --> Results in "Unexpected exception while handling" error

       

      I have also tried using a Directory configuration object exists rule: "Directory:/??SQLDATA.DEFAULT_DATA" exists. This results in a fata exception.

       

      My goal is to be able to script the value of DEFAULT_DATA based on the values from multiple target servers where the DEFAULT_DATA value could be different for each target. Within the Component Template, I want to be able to write server neutral rules that are parameterized so I can effectively deploy the Compliance jobs across our environment.

       

      What is the correct format and usage of custom class properties within compliance rules? I would appreciate any help or recommendations. Thanks