I’ve been working a lot on config migrations lately – specifically migrating FIM configuration from dev to test to prod. I wanted to be able to easily compare two Sync Service configurations: before a migration to see what the differences are; after a migration to confirm that the servers are now the same; as a record of the before vs after changes on the one server.
So of course I wrote a couple of scripts.
ConvertToCSV-SyncConfig.ps1
The first script takes the name of the folder where you’ve exported a full server config and converts the XMLs to a series of sorted CSV files, which are easier to compare.
.\ConvertToCSV-SyncConfig.ps1 -ServerConfigFolder "E:\fim\DevSvrCfg" -prefix "dev"
When I convert a second server config folder I use a different prefix so I can tell them apart:
.\ConvertToCSV-SyncConfig.ps1 -ServerConfigFolder "E:\fim\PrdSvrCfg" -prefix "prd"
CompareCSV-SyncConfig.ps1
The final step is to compare the two sets of CSV files. (And I’ll have to thank Craig Martin here for very handily pointing out the use of Compare-Object right after I’d written the first version of this script to use the old DOS fc command.) The output is one “diff” file for each of the CV files, listing the lines that appear in one CSV but not the other.
.\CompareCSV-SyncConfig.ps1 -prefix1 "dev" -prefix2 "prd"
To get the scripts
Go to the FIM Team Community Script site and download “Sync Config Comparison.zip”.