How to speed up Export-FIMConfig queries?

I'm trying to write some PoSh scripts to pull information from FIM, and, Holy Toledo Batman!, they are slow! 

In the time it takes to run get results from a command like:

Export-FIMConfig -uri $FIMURI -onlybaseresources -customconfig ("/Group[Owner='$FIMuserObjID']")

I could easily start the web portal, manually log in, and load and peruse through a dozen pages.  All I really want is the group names and the object identifiers.  Why is this so slow? 

In searching for a way to speed this up, I have tried splitting it into simultaneous background jobs adding:

/Group[(starts-with(DisplayName,'$($letter)'))]

to the config and cycling through the alphabet, but because PoSh jobs each have to load the FIMAutomation snapin, it doesn't speed things up much and uses a lot of resources. 

I'm trying to wrap my head around using runspaces to do the same thing, but I'm not really certain it's any better.  All the examples and scripts "out there" involve distributing the load across multiple computers, not multi-threading on the same computer.  I realize there are "concerns" related to garbage collection and locking, but I'm not interested in using it for changing anything.  I just want to have a reasonable query response time.  I have some code that runs without error, but I'm not getting any results (as far as I can tell). 

Can someone tell me if runspaces are likely to help here (or not) and, if you are really kind, offer some assistance in getting it working?

Thanks.

January 27th, 2015 7:11pm

Hi cascomp,

I don't have any "powershell solutions" to speed up "Export-FimConfig".

You can try to increase the capacities of your SQL and FIM server (CPU and RAM)

or try to use a C# solution, based on this fork of FimClient

This client allows you to do pagination and to select which attributes you want to retrieve from the FIM WebService.

Regards,

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 6:18pm

I'm not the FIM or SQL server administrator, so I can't change their capacity.

Regardless, doesn't the FIM webservice make calls to the same FIM/SQL server?  How can the web service be so much faster when there is an additional process of building the web page on the fly?  Why is the PowerShell interface which allows bulk access/changes with FIM many, many times slower than the clunky, user-oriented, manual and piecemeal web interface? 

Am I crazy to think this is backwards?  Doesn't this bother anyone else?

Thanks.

January 29th, 2015 6:25pm

Well, I don't have any clues about how FIM Web pages are develop, but powershell will retrieves the entire object, when probably FIM will only get a few attributes...

It's also depending how many objects your xpath will return.

When I need to treat a large amount of objects, I simply use C#

Regards,

Free Windows Admin Tool Kit Click here and download it now
January 29th, 2015 7:07pm

If only using C# were so simple.

It seems to me that if C# is able to interface with FIM efficiently, then somebody (probably at Microsoft) needs to write a PowerShell module/snapin that utilizes that efficiency. 

There is a huge gap between minor admins who know some PowerShell and would like to simplify their work without manually working in Group Access Manager and developers who "simply use C#". 

When Quest created their ActiveRoles AD Powershell extension, it opened a whole world of easy-to-use possibilities for many, many people like me, and a lot of good work got done.  The same could happen for FIM. 

Thanks for the responses though.

February 2nd, 2015 3:00pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics