Tuesday, November 25, 2014

Counting Members in a FIM Set

Troubleshooting a strange configuration issue today and am trying to figure out why performance of references is less than awesome.

This particular query helped narrow down the problem.  For some reason I have a bunch of Sets with huge numbers of explicit members.  The sample is a good illustration of getting the data out of the FIM Service, then querying it and formatting it using PowerShell.  In some cases you can define a better query using XPath against the FIM Service but often it is easier to just do it in PowerShell.

Here’s the query to find the sets:


### Get all the Sets

Export-FIMConfig -OnlyBaseResources -CustomConfig "/Set" |

### Convert to PSObjects (easier to deal with than FIM Export Objects)

Convert-FimExportToPSObject |

### Get just the Sets with ExplicitMember

Where-Object ExplicitMember |

### Sort by the count of members

Sort-Object {$_.ExplicitMember.Count} -Descending  |

### Output as a nice table

Format-Table DisplayName, @{Name='ExplicitMemberCount';Expression={$_.ExplicitMember.Count}} -AutoSize




DisplayName                           ExplicitMemberCount

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

Administrators                                          1

Password Reset Objects Set                              4

Crazy Set One                                      200000

FIM Support Tier One                                    7

FIM Programmatic Access                                 4






No comments: