Thursday, May 08, 2014

Comparing FIM Requests

Troubleshooting FIM Service requests can be tricky, sometimes you really want to know why one request failed while another succeeded.

Finding the differences between two requests can be difficult to eyeball in the FIM Portal because the request parameters (the detail in the ‘Detailed Content’ tab of a FIM Request) are difficult to compare side-by-side.  Also, these are difficult to compare when you export the attribute because they are stored as XML strings.

PowerShell to the rescue!

The sample below uses the PowerShell Compare-Object cmdlet to find the differences in two FIM RequestParameter arrays.  The arrays are created using the Get-FimRequestParameter function from the FIM PowerShell Module.



asnp fimautomation

ipmo FimPowerShellModule



Get the Request Parameters for Two Requests.  They basically look like this:


Mode Operation PropertyName Value           

---- --------- ------------ -----

     Create    Description  some funny description 

     Create    DisplayName  _DscTestSet1

     Create    Filter       <Filter xmlns:xsi='

     Create    ObjectType   Set 

     Create    ObjectID     14221f54-3f17-4026-9097-10201993794d 

     Create    Creator      7fb2b853-24f0-4498-9534-4e10589723c4 

     Create    Temporal     false                     


$p1 = Export-FIMConfig -only -custom "/Request[ObjectID='5f770f4e-80ea-4910-a2aa-93d9a6a8abb3']" | Convert-FimExportToPSObject | Get-FimRequestParameter

$p2 = Export-FIMConfig -only -custom "/Request[ObjectID='35be2ef9-3930-48b7-82b9-816c944cfd76']" | Convert-FimExportToPSObject | Get-FimRequestParameter


### Compare the Request Parameters

Compare-Object $p1 $p2 -Property PropertyName,Value



The output shows the differences:


PropertyName Value                                SideIndicator

------------ -----                                -------------

ObjectID     88272395-ccb1-4238-8095-2d4ea89a9adf =>          

ObjectID     14221f54-3f17-4026-9097-10201993794d <=          





No comments: