MimSyncImportAttributeFlowRule - microsoft/MIMDSC GitHub Wiki

This resource is for MIM Sync import attribute flow rules.

The DSC resource configuration below validates the MIM Sync configuration by inspecting the XML below. TODO - include screen shots of the MIM Sync UI

DSC Configuration

This is a sample DSC configuration including just the Import Attribute Flow Rule resource type.

Configuration TestMimSyncImportAttributeFlowRule 
{ 
    Import-DscResource -ModuleName MimSyncDsc

    Node (hostname) 
    { 
        ImportAttributeFlowRule TestMimSyncImportAttributeFlowRule
        {
            ManagementAgentName    = 'TinyHR'
            MVObjectType           = 'SyncObject'
            MVAttribute            = 'FirstName'
            CDObjectType           = 'person'
            Type                   = 'direct-mapping'
            SrcAttribute           = 'FirstName'
            Ensure                 = 'Present'
        }
    }
} 

MIM Sync XML

This is the XML exported from the Sync Service, which is what the DSC resource validates.

<mv-data>
    <import-attribute-flow>
        <import-flow-set mv-object-type="SyncObject">
            <import-flows mv-attribute="FirstName" type="ranked">
                <import-flow src-ma="{9C3614F6-F975-4F32-9504-C821CBE36471}" cd-object-type="person" id="{1E6AE212-C542-4355-9A45-29886CE561F8}">
                    <direct-mapping>
                        <src-attribute>FirstName</src-attribute>
                    </direct-mapping>
                </import-flow>
            </import-flows>            
            <import-flows mv-attribute="Title" type="ranked">
                <import-flow src-ma="{9C3614F6-F975-4F32-9504-C821CBE36471}" cd-object-type="person" id="{9997656D-B201-4B38-8504-87724F98CB62}">
                    <direct-mapping>
                        <src-attribute>JobTitle</src-attribute>
                    </direct-mapping>
                </import-flow>
            </import-flows>                        
            <import-flows mv-attribute="DisplayName" type="ranked">
                <import-flow src-ma="{9C3614F6-F975-4F32-9504-C821CBE36471}" cd-object-type="person" id="{C5681D2C-33D0-47EB-812E-9A90E5B691CC}">
                    <scripted-mapping>
                        <src-attribute>FirstName</src-attribute>
                        <src-attribute>Initial</src-attribute>
                        <src-attribute>LastName</src-attribute>
                        <src-attribute>Title</src-attribute>
                        <script-context>cd.person:FirstName,LastName-&gt;mv.SyncObject:DisplayName</script-context>
                    </scripted-mapping>
                </import-flow>
            </import-flows>
            <import-flows mv-attribute="Fax" type="ranked">
                <import-flow src-ma="{9C3614F6-F975-4F32-9504-C821CBE36471}" cd-object-type="person" id="{81E84777-4E79-47D8-A967-155FA3057C17}">
                    <direct-mapping>
                        <src-attribute intrinsic="true">dn</src-attribute>
                    </direct-mapping>
                </import-flow>
            </import-flows>
            <import-flows mv-attribute="OnPremiseObjectType" type="ranked">
                <import-flow src-ma="{9C3614F6-F975-4F32-9504-C821CBE36471}" cd-object-type="person" id="{1A6C290A-9982-4111-A2D7-F1FDBE4B2283}">
                    <constant-mapping>
                        <constant-value>superPerson</constant-value>
                    </constant-mapping>
                </import-flow>
            </import-flows>
            <import-flows mv-attribute="RetentionUrl" type="ranked">
                <import-flow src-ma="{9C3614F6-F975-4F32-9504-C821CBE36471}" cd-object-type="person" id="{08CC44AA-55FC-4C60-9A90-28BE4708BDC2}">
                    <dn-part-mapping>
                        <dn-part>3</dn-part>
                    </dn-part-mapping>
                </import-flow>
            </import-flows>
        </import-flow-set>

DSC Verbose Output

This is sample log output showing what DSC does with the resource to validate the configuration.

VERBOSE: Using CacheLocation: C:\ProgramData\MimSyncDsc\Svrexport
VERBOSE: Using CacheAge:      1440 (in minutes)
VERBOSE: Cache still valid, leave it
VERBOSE: Finding import attribute flow rule [TinyHR].person.[FirstName,LastName,Title] --> MV.SyncObject.[DisplayName] ...
VERBOSE:   Using XPath: //mv-data/import-attribute-flow/import-flow-set[@mv-object-type='SyncObject']/import-flows[@mv-attribute='DisplayName']/import-flow[@src-ma='{9C3614F6-F975-4F32-9504-C821CBE36471}' and
 @cd-object-type='person' and scripted-mapping]
VERBOSE: Attribute flow rule found, diffing the properties...
VERBOSE:   Comparing property 'type'
VERBOSE:     From DSC: scripted-mapping
VERBOSE:     From MIM: scripted-mapping
VERBOSE:   Comparing property 'cd-object-type'
VERBOSE:     From DSC: person
VERBOSE:     From MIM: person
VERBOSE:   Comparing property 'script-context'
VERBOSE:     From DSC: cd.person:FirstName,LastName->mv.SyncObject:DisplayName
VERBOSE:     From MIM: cd.person:FirstName,LastName->mv.SyncObject:DisplayName
VERBOSE:   Comparing property 'src-attribute'
VERBOSE:     From DSC: FirstName,LastName,Title
VERBOSE:     From MIM: FirstName,Initial,LastName,Title
WARNING:   'src-attribute' property is not the same.
VERBOSE: Returning: False
⚠️ **GitHub.com Fallback** ⚠️