{"id":2017,"date":"2012-05-16T08:22:03","date_gmt":"2012-05-16T08:22:03","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=2017"},"modified":"2022-08-21T16:39:44","modified_gmt":"2022-08-21T16:39:44","slug":"a-script-to-make-fim-policy-self-documenting","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/a-script-to-make-fim-policy-self-documenting","title":{"rendered":"A Script to make FIM Policy &#8220;Self-Documenting&#8221;"},"content":{"rendered":"<p>There&#8217;s an ongoing problem with maintaining a system that has all the configuration possibilities of FIM. Documentation is usually out of date the moment it&#8217;s written and it&#8217;s a cumbersome way to try and understand a system anyway. One thing that can at least make your Policy configuration a bit easier to understand is to be able to see which MPRs use which Sets and Workflows. Now I know you can see this info if you look at the MPR object &#8211; but what if I&#8217;m looking at a Set or Workflow? How do I quickly see which MPRs are using that object, and thereby assess its purpose?<\/p>\n<p><!--more--><\/p>\n<p>Searching is cumbersome and I&#8217;ll have to specify multiple possible MPR attributes. It&#8217;s also no good if I want to review a number of Sets or Workflows at once.<\/p>\n<p>So what I decided to do was write a script which updates Set and Workflow objects with a list of the MPRs using them. I started out with the Description field but quickly ran up against the length limit, so instead I created a new <em>unindexed string<\/em> attribute called &#8220;ReferringMPRs&#8221;, which I bound to both the Set and WorkflowDefinition object types. I&#8217;ve added this attribute to the Search Scope definitions so it&#8217;s easy to see:<\/p>\n<p><a href=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2012\/05\/ReferringMPRs.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2018\" title=\"ReferringMPRs\" src=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2012\/05\/ReferringMPRs.jpg\" alt=\"\" width=\"1058\" height=\"337\" srcset=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2012\/05\/ReferringMPRs.jpg 1058w, https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2012\/05\/ReferringMPRs-300x95.jpg 300w, https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2012\/05\/ReferringMPRs-1024x326.jpg 1024w\" sizes=\"auto, (max-width: 1058px) 100vw, 1058px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<p>Next I wrote a script which I schedule to run once a week. It updates the ReferringMPRs attribute on each Set and WorkflowDefinition with the list of MPRs referencing it. Note I don&#8217;t differentiate on where the MPR is using the object &#8211; ie I don&#8217;t care which phase the Workflow runs in, or which role the Set is performing. When trying to figure out what a Set or Workflow is used for I often won&#8217;t need this level of detail &#8211; it&#8217;s enough to know that the MPR is using it somehow. You are of course welcome to take the script and modify it if you think it should do more.<\/p>\n<p>On a suggestion from my colleague Pete Wass I added an extra function to the script. If you feed it a folder name it will create a datestamped report in that folder if it finds differences in the list of referring MPRs.<\/p>\n<p>You can grab a copy of the script from the <a href=\"https:\/\/unifysolutions.jira.com\/wiki\/display\/FIMTEAMCOM\/Documentation+Scripts\">FIM Team Scripts site<\/a>.<\/p>\n<p>\u00a0<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s an ongoing problem with maintaining a system that has all the configuration possibilities of FIM. Documentation is usually out of date the moment it&#8217;s written and it&#8217;s a cumbersome way to try and understand a system anyway. One thing that can at least make your Policy configuration a bit easier to understand is to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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":[55,42,62,23,54,45],"tags":[],"class_list":["post-2017","post","type-post","status-publish","format-standard","hentry","category-best-practice","category-fim-2010","category-mpr","category-powershell","category-sets","category-workflow"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-wx","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2017","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=2017"}],"version-history":[{"count":10,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2017\/revisions"}],"predecessor-version":[{"id":3295,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2017\/revisions\/3295"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=2017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=2017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=2017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}