{"id":2554,"date":"2013-03-05T02:57:02","date_gmt":"2013-03-05T02:57:02","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=2554"},"modified":"2013-03-08T22:17:32","modified_gmt":"2013-03-08T22:17:32","slug":"breaking-down-the-size-of-you-fim-service-query-with-powershell","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/breaking-down-the-size-of-you-fim-service-query-with-powershell","title":{"rendered":"Breaking down the size of a FIM Service query with PowerShell"},"content":{"rendered":"<p>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.<!--more--><\/p>\n<pre>$i = 65\r\ndo\r\n{\r\n    $c = [char]$i\r\n\r\n    $filter = \"\/Person[starts-with(DisplayName,'{0}')]\" -f $c\r\n    $objs = export-fimconfig -CustomConfig $filter -OnlyBaseResources\r\n\r\n    foreach ($obj in $objs)\r\n    {\r\n        <em>whatever you need to do<\/em>\r\n    }\r\n\r\n    $i += 1\r\n\r\n} while ($i -lt 91)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[42,60,23],"tags":[],"class_list":["post-2554","post","type-post","status-publish","format-standard","hentry","category-fim-2010","category-fim-2010-r2","category-powershell"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-Fc","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=2554"}],"version-history":[{"count":5,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2554\/revisions"}],"predecessor-version":[{"id":2564,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2554\/revisions\/2564"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=2554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=2554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=2554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}