Comparing MV Schemas RRS feed

  • General discussion

  •   ILM Knowledge Bit

    Lately I've been doing a lot of Synchronization mash-ups where we have to consolidate synchronization servers into one.
    It is handy to compare the MV schemas with script, especially when there are lots of attributes involved.

    This short PowerShell snippet shows how to compare two MV schema files. 
    It assumes you have exported the schema from both servers and have access to the two MV.XML files.


      note Note
      The script is specifically looking at the 'Person' object type.  I find it useful to compare by type. 


    [XML]$mv1XML = Get-Content "D:\HoofHearted\MV.XML"
    [XML]$mv2XML = Get-Content "D:\IceMelted\MV.XML"
    $mv1 = $mv1XML.'saved-mv-configuration'.'mv-data'.'schema.dsml'.'directory-schema'.class | where {$_.name -eq 'person'} | select -ExpandProperty attribute | select ref
    $mv2 = $mv2XML.'saved-mv-configuration'.'mv-data'.'schema.dsml'.'directory-schema'.class | where {$_.name -eq 'person'} | select -ExpandProperty attribute | select ref
    Write-Host "Comparing MV1 to MV2..." -ForegroundColor blue
    Compare-Object $mv1 $mv2 

    Happy Diff'ing!

      Go to the ILM Knowledge Bit Collection

    CraigMartin – Edgile, Inc. – http://identitytrench.com
    Tuesday, July 27, 2010 12:07 AM