When trying to perform bulk operations against objects in FIM from PowerShell you can run into some pretty slow and heavy going queries. This little snippet shows how you can loop through each letter of the alphabet as a way to reduce the size of the batch of objects you deal with in one go.
$i = 65 do { $c = [char]$i $filter = "/Person[starts-with(DisplayName,'{0}')]" -f $c $objs = export-fimconfig -CustomConfig $filter -OnlyBaseResources foreach ($obj in $objs) { whatever you need to do } $i += 1 } while ($i -lt 91)
Hi Carol,
The code below uses your ideas but goes three levels deep to start with, e.g., ‘Aba’ rather than ‘A’. So that even in a very large environment, results begin to show up early:
Awesome! Thanks for sharing.