FIM EventLog records errors on searches

I’m currently debugging some custom workflow activities and updating the logging code so it produces more useful information (apparently my ‘development’ error codes aren’t human readable enough!) and noticed that I was getting lots of ‘KeyNotFound’ exceptions in the event log.

Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other —> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

After much digging through my code I spotted that this was actually being generated whenever I read from FIM in the Portal and while it was a relief to know that my workflow code was off the hook I didn’t really want to leave this in place and cluttering up the eventlog.

It looks like this was introduced during one of the hotfix releases (4.1.3496 is mentioned in the article I’ve linked to below) when additional Portal configuration was introduced to allow the Advanced Search option to be turned off – this means that my local FIM installation was actually attempting to locate an attribute on the Portal Configuration that I didn’t have in my schema which was the cause of the KeyNotFound exceptions I was finding.

The steps to fix is are fairly simple as follows (Steps taken from the referenced documents – not my own work – see below for links)

To enable the configuration and remove the Advanced Search link, follow these steps:

  1. In Administration, click Schema Management, and then click All Attributes.
  2. Create a new Boolean attribute that is named “HideAdvancedSearchLink.”
  3. In All Bindings, create a new binding for the HideAdvancedSearchLink attribute to the Portal Configuration resource, and then click Finish to save the binding.
  4. Create a new Management Policy Rule (MPR) to allow for changes to the new binding in the portal configuration. To do this, use the following configuration for the new MPR:Display Name: Administrators can modify the HideAdvancedSearchLink attribute in the Portal Configuration resource
    Type: Request
    Disabled: False
    Specific Set of Requestors: All Administrators
    Operation: Modify a single-valued attribute
    Permissions: Grants permission
    Target Resource Definition Before Request: All Basic Configuration Objects
    Target Resource Definition After Request: All Basic Configuration Objects
    Resource Attributes: Select specific attributes: HideAdvancedSearchLink
  5. Reset Internet Information Services (IIS), and then restart the FIM service.
  6. In Administration, click Portal Configuration, and then click Extended Attributes. You should see theHideAdvancedSearchLink attribute together with the other extended attributes.
  7. Click to select the HideAdvancedSearchLink check box, and then click Submit to enable the hiding of the Advanced Search link.
  8. Verify that the Advanced Search link is not available in the list views. For example, check the following list views:
  9. My DGs
  10. My DG Memberships
  11. Management Policy Rules

Once I had this implemented and FIM restarted the errors were removed and I was left with the exceptions of my own making again – yay I think!

Links for the above are to:

Blog Post – http://www.networksteve.com/windows/topic.php/Error_raised_in_the_event_log_when_browsing_the_portal/?TopicId=61333&Posts=3

KB Article –https://support.microsoft.com/en-us/kb/2906832/en-us

This entry was posted in FIM, Snippets, Troubleshooting and tagged , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *