BPOS Powershell Activity

Here’s something I’ve been promising to post for a while – my BPOS Powershell Activity.

It’s designed to work with the Function Evaluator

The first point to note is that, unless you’re running a script or cmdlet that takes no parameters, you’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.

The Parameter string must be in an expected format

My activity only supports parameter strings in the format “-Param ‘Argument’ -Param ‘Argument'”.

  • Scripts using the arg(0), arg(1) method are not supported.
  • String arguments only.
  • All arguments have to be enclosed in single-quotes, even if you don’t have to do this when running the cmdlet directly in powershell.

Using the Activity

General Control Settings

  • Enable/Disable activity
  • Logging to Application Event Log
  • Workflow type:
    • Action: activity completes irrespective of powershell return value,
    • AuthZ: activity fails if powershell returns an error.

Powershell Command

  • Name of powershell cmdlet or full path to script
  • Specify plugin (in case using another library, eg., MessageOps)
  • Parameters passed via WorkflowData parameter generated earlier (see above).

Return Values

  • Specify WorkflowData parameters to return the result of the powershell command (“Succeeded”,”Failed”) and/or a detailed message. These can then be used in a subsequent activity, such as a Notification.

Post-Execution Behaviour

  • Reverse simple changes in certain cases eg.,
    • Clear a change password attribute on both success and failure,
    • Clear a check box if the requested change failed.

Connection Settings

  • If using Remote Powershell specify the remote server name and connection details. Assumes “localhost” if left blank.
  • Specify BPOS username and password of an administrator account.
  • Note that passwords must be re-entered whenever the activity is edited.

The Code

You can download a copy of the activity here.

Please note you will need to fix the references and compile it yourself.

This code is provided as an example only with no warranty or support. It may not be applicable for your environment. Make sure you understand it and adapt it appropriately.

3 Replies to “BPOS Powershell Activity”

  1. This looks great– I had been using the other powershell activity you posted, but for some reason I cannot get this one to appear in FIM as an option. I’m thinking it’s possibly the AIC information. Any chance you can post that (as it should appear with the above code built with no changes)?

    Thanks 🙂

  2. I don’t have access to anywhere that it’s installed right now. The best thing is to use the Object Browser in Visual Studio to make sure you have the library names exactly right. Also check the FIM event log – if it’s failing to load a dll because of an incorrect name in the AIC then there should be something in there.

  3. Wow thanks a lot– that fixed it! I could see via the object browser that I had the ‘Type Name’ in the AIC incorrect. Now I can play with this new activity 🙂

    Thanks again!

Leave a Reply

Your email address will not be published. Required fields are marked *