{"id":1424,"date":"2011-05-03T18:24:07","date_gmt":"2011-05-03T18:24:07","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=1424"},"modified":"2011-05-04T05:15:33","modified_gmt":"2011-05-04T05:15:33","slug":"bpos-powershell-activity","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/bpos-powershell-activity","title":{"rendered":"BPOS Powershell Activity"},"content":{"rendered":"<p>Here&#8217;s something I&#8217;ve been promising to post for a while &#8211; my BPOS Powershell Activity.<br \/>\n<!--more--><\/p>\n<h3>It&#8217;s designed to work with the Function Evaluator<\/h3>\n<p>The first point to note is that, unless you&#8217;re running a script or cmdlet that takes no parameters, you&#8217;re going to have to generate a parameter string. For BPOS this will include the BPOS Identity as a minimum. I use the Function Evaluator ahead of this activity to generate my powershell parameter string, which I then pass to the powershell activity through WorkflowData.<\/p>\n<p><a href=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity-funtion-evaluator.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1425\" title=\"bpos activity funtion evaluator\" src=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity-funtion-evaluator.jpg\" alt=\"\" width=\"574\" height=\"321\" srcset=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity-funtion-evaluator.jpg 718w, https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity-funtion-evaluator-300x167.jpg 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/a><\/p>\n<h3>The Parameter string must be in an expected format<\/h3>\n<p>My activity only supports parameter strings in the format &#8220;-Param &#8216;Argument&#8217; -Param &#8216;Argument'&#8221;.<\/p>\n<ul>\n<li>Scripts using the arg(0), arg(1) method are not supported.<\/li>\n<li>String arguments only.<\/li>\n<li>All arguments have to be enclosed in single-quotes, even if you don&#8217;t have to\u00c2\u00a0do this when running the cmdlet directly in powershell.<\/li>\n<\/ul>\n<h3>Using the Activity<\/h3>\n<p><a href=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1426\" title=\"bpos activity\" src=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity.jpg\" alt=\"\" width=\"578\" height=\"474\" srcset=\"https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity.jpg 723w, https:\/\/www.wapshere.com\/missmiis\/wp-content\/uploads\/2011\/05\/bpos-activity-300x246.jpg 300w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/a><br \/>\n<strong>General Control Settings<\/strong><\/p>\n<ul>\n<li>Enable\/Disable activity<\/li>\n<li>Logging to Application Event Log<\/li>\n<li>Workflow type:\n<ul>\n<li>Action: activity completes irrespective of powershell return value,<\/li>\n<li>AuthZ: activity fails if powershell returns an error.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Powershell Command<\/strong><\/p>\n<ul>\n<li>Name of powershell cmdlet or full path to script<\/li>\n<li>Specify plugin (in case using another library, eg., <a href=\"http:\/\/www.messageops.com\/software\/messageops-microsoft-online-powershell-extensions\">MessageOps<\/a>)<\/li>\n<li>Parameters passed via WorkflowData parameter generated earlier (see above).<\/li>\n<\/ul>\n<p><strong>Return Values<\/strong><\/p>\n<ul>\n<li>Specify WorkflowData parameters to return the result of the powershell command (&#8220;Succeeded&#8221;,&#8221;Failed&#8221;) and\/or a detailed message. These can then be used in a subsequent activity, such as a Notification.<\/li>\n<\/ul>\n<p><strong>Post-Execution Behaviour<\/strong><\/p>\n<ul>\n<li>Reverse simple changes in certain cases eg.,\n<ul>\n<li>Clear a change password attribute on both success and failure,<\/li>\n<li>Clear a check box if the requested change failed.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Connection Settings<\/strong><\/p>\n<ul>\n<li>If using Remote Powershell specify the remote server name and connection details. Assumes &#8220;localhost&#8221; if left blank.<\/li>\n<li>Specify BPOS username and password of an\u00c2\u00a0administrator account.<\/li>\n<li>Note that <strong>passwords must be re-entered<\/strong> whenever the activity is edited.<\/li>\n<\/ul>\n<h3>The Code<\/h3>\n<p>You can download a copy of the activity <a href=\"https:\/\/www.wapshere.com\/dl\/BPOS%20Powershell.zip\">here<\/a>.<\/p>\n<p>Please note you will need to fix the references and compile it yourself.<\/p>\n<blockquote><p>This code is provided as an <em>example only<\/em> with <strong>no warranty or support<\/strong>. It may not be applicable for your environment. Make sure you understand it and adapt it appropriately.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s something I&#8217;ve been promising to post for a while &#8211; my BPOS Powershell Activity.<\/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":[47,42,30,45],"tags":[],"class_list":["post-1424","post","type-post","status-publish","format-standard","hentry","category-bpos","category-fim-2010","category-vbnet","category-workflow"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-mY","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/1424","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=1424"}],"version-history":[{"count":9,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/1424\/revisions"}],"predecessor-version":[{"id":1434,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/1424\/revisions\/1434"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=1424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=1424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=1424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}