The PowerShell module has its own built-in support for configuration management and control within the FIM service. Using an XML file, you can define how resources should appear in the FIM service, and use the [[Import-RMConfig]] cmdlet to create, update, and delete resources and attributes as appropriate. The module also supports the use of variables and placeholders to make transitioning configuration between environments as seamless as possible.
Ike Ugochuku has produced a getting started guide to introduce you to configuration management and [[Import-RMConfig]].
The XML file structure allows you to not only reference objects in the FIM Service, but also to reference other resources described in XML. This can ensure referential integrity and maintain relationships between objects that may or may not have been created in the FIM service. See the topic on [[Building References]] for more information
Sample XML file
The following demonstrates how to describe a set, workflow and MPR in an XML file that can be applied using the Import-RMConfig cmdlet.
<?xml version="1.0" encoding="utf-8" ?><Lithnet.ResourceManagement.ConfigSync> <Variables> <Variablename="#domain#"value="%userdomain%"/> <Variablename="#PATH#"value =".\" /> </Variables> <Operations><!-- Create Set --> <ResourceOperationoperation="Add Update"resourceType="Set"id="demoSet"> <AnchorAttributes> <AnchorAttribute>DisplayName</AnchorAttribute> </AnchorAttributes> <AttributeOperations> <AttributeOperationoperation="replace"name="DisplayName">___Demo Set</AttributeOperation> <AttributeOperationoperation="replace"name="Description">Contains all the test users for the purpose of this demo</AttributeOperation> <AttributeOperationoperation="replace"name="Filter"type="filter">/Person[starts-with(AccountName, 'testuser')]</AttributeOperation> </AttributeOperations> </ResourceOperation><!-- Create Email Template --> <ResourceOperationoperation="Add Update"resourceType="EmailTemplate"id="demoEmailTemplate"> <AnchorAttributes> <AnchorAttribute>DisplayName</AnchorAttribute> </AnchorAttributes> <AttributeOperations> <AttributeOperationoperation="replace"name="DisplayName">___Demo Email Template</AttributeOperation> <AttributeOperationoperation="replace"name="Description">An email template created for the purpose of this demo</AttributeOperation> <AttributeOperationoperation="replace"name="EmailTemplateType">Notification</AttributeOperation> <AttributeOperationoperation="replace"name="EmailBody"type="file">#PATH#Templates\EmailTemplate.html</AttributeOperation> <AttributeOperationoperation="replace"name="EmailSubject">Hello FIM user group</AttributeOperation> </AttributeOperations> </ResourceOperation><!-- Create Workflow Definition --> <ResourceOperationoperation="Add Update"resourceType="WorkflowDefinition"id="demoWorkflowDefinition"> <AnchorAttributes> <AnchorAttribute>DisplayName</AnchorAttribute> </AnchorAttributes> <AttributeOperations> <AttributeOperationoperation="replace"name="DisplayName">___Demo Workflow Definition</AttributeOperation> <AttributeOperationoperation="replace"name="Description">Sends an account expiry notification email to users email address2</AttributeOperation> <AttributeOperationoperation="replace"name="XOML"type="file">#PATH#Templates\WFDemo.xml</AttributeOperation> <AttributeOperationoperation="replace"name="RequestPhase">Action</AttributeOperation> <AttributeOperationoperation="replace"name="RunOnPolicyUpdate">false</AttributeOperation> </AttributeOperations> </ResourceOperation><!-- Create MPR --> <ResourceOperationoperation="Add Update"resourceType="ManagementPolicyRule"id="demoMPR"> <AnchorAttributes> <AnchorAttribute>DisplayName</AnchorAttribute> </AnchorAttributes> <AttributeOperations> <AttributeOperationoperation="replace"name="DisplayName">___Demo MPR - Triggers Workflow</AttributeOperation> <AttributeOperationoperation="replace"name="Description">Triggers the "##xmlref:demoWorkflowDefinition:DisplayName##" workflow when a user account transitions into the "##xmlref:demoSet:DisplayName##" set</AttributeOperation> <AttributeOperationoperation="replace"name="ActionParameter">*</AttributeOperation> <AttributeOperationoperation="replace"name="ActionType">TransitionIn</AttributeOperation> <AttributeOperationoperation="replace"name="ActionWorkflowDefinition"type="xmlref">demoWorkflowDefinition</AttributeOperation> <AttributeOperationoperation="replace"name="Disabled">false</AttributeOperation> <AttributeOperationoperation="replace"name="GrantRight">false</AttributeOperation> <AttributeOperationoperation="replace"name="ManagementPolicyRuleType">SetTransition</AttributeOperation> <AttributeOperationoperation="replace"name="ResourceFinalSet"type="xmlref">demoSet</AttributeOperation> </AttributeOperations> </ResourceOperation> </Operations></Lithnet.ResourceManagement.ConfigSync>
Default XSD Schema
The following is the complete XSD schema that can be used for validating a ResourceManagement Configuration file. Thanks to Thomas Weyermann for documenting this.