none
Trigger a MPR on a specific time RRS feed

  • Question

  • Hi,

    I have a requirement to trigger a MPR at exactly at 07h00, is this possible? and how?  I have reviewed some of the articles on this topic, but they concentrate more on a specific date.

    I have created a custom Workflow activity to send a SMS to a user when a password is about to expire.  The TemporalEventsJob runs at 00h00 resulting in the SMS going out at about 01h00 in the morning, I want to change / delay the SMS to 07h00 without changing the schedule of the TemporalEventsJob.

    Thanks

    Johan Marais


    JkM6228

    Monday, February 17, 2014 1:43 PM

Answers

  • Take a look at the bulk update script in the script box: http://social.technet.microsoft.com/wiki/contents/articles/2168.how-to-use-powershell-to-bulk-update-the-value-of-an-attribute-for-a-certain-type.aspx

    It is an example of how to query FIM from PowerShell and update an attribute on all the records found. When you query FIM from PowerShell you use a special query syntax that is similar to XPath. The bulk update script updates all records for a given object type by default. It is intended to update all People for example (and uses the query "/Person" to do this).

    What you could do is add an attribute in the FIM Service called "QueueSMS" or similar. Next create a Transition-In MPR / workflow that sets the QueueSMS attribute to "Yes" when a user transitions into your set of people whose password is about to expire. You would next modify the query in the Bulk Import script to be /Person[QueueSMS="Yes"] - This would pull back just the users that have been determined to need notification.

    Now you can run the script whenever you want and you get a list of users that need notification. You would have the script set the QueueSMS attribute to "No" so that you don't repeat the notification. (The Bulk Import script already has the code to do this - it sets an attribute to a value)

    All that is left is to extend the script to send the actual SMS, or to update some other attribute on your user that in turn would trigger your workflow that sends the SMS.



    • Edited by Rex Wheeler Friday, February 21, 2014 7:12 AM Correct Typo
    • Marked as answer by Johan Marais Friday, February 28, 2014 11:57 AM
    Thursday, February 20, 2014 6:56 PM

All replies

  • If you don't want to change schedule of TemporalEventsJob, the only way I could think of is to use some external tool, based on file or table in database.

    You could use powershell activity invoked by transition MPR to create such notification entry in file/table or you could propagate it as an object to Synch Engine and then to file/table.

    Your script/tool would be invoked once a day, at 7 am and it would sent emails based on file/database entries.


    Keep trying

    Monday, February 17, 2014 2:13 PM
  • I would set up a scheduled task that runs a PowerShell script that makes an update to an object in the FIM Service that would trigger your MPR. This assumes that you have a specific MPR on a specific object that you want to trigger and that your custom activity "finds" all the users that need notification.

    If on the other hand you have a MPR per user that needs to be triggered at a specific time, you might want to have a scheduled task, that runs a PowerShell script that searches for users in need of notification and for each of these users, sends the SMS (from PowerShell) or updates an attribute on the user object that in turn triggers the MPR to send the SMS from workflow.

    Tuesday, February 18, 2014 4:32 PM
  • You can also edit the SQL job itself which evaluates and runs the temporal set. You can change the schedule of this job to run at whatever time you want, but bear in mind this will have an impact on ALL temporal sets

    More details here:

    http://technet.microsoft.com/en-us/library/ff830030(v=ws.10).aspx

    Tuesday, February 18, 2014 6:13 PM
  • Rex,

    Thanks for your advice, I will try this.  I already have a Set which gathers the users who's passwords are about to expire.  I will add an attribute to the user object  which will be populated by the PowerShell script to trigger the MPR.  This attribute will again be reset in the WF as a last step to be ready for the next cycle.  We send a SMS on 5 days, 3 days and 1 day prior to expiry.  We have three different Sets for this.

    I am not that strong on PowerShell :-), have you got an example of a PowerShell script that can update a specific attribute for users of a specific Set?

    Thanks

    Johan Marais


    JkM6228

    Wednesday, February 19, 2014 6:07 AM
  • kmittal82,

    Thanks for your advice but I don't want to change the schedule of the TemporalEventsJob due to the impact on other processes.

    Thanks

    Johan Marais


    JkM6228

    Wednesday, February 19, 2014 6:09 AM
  • Please check this PowerShell script:

    http://social.technet.microsoft.com/wiki/contents/articles/2930.how-to-use-powershell-to-add-a-member-to-a-group-in-fim.aspx

    Just change Group to Set and you'd have an powershell script that adds a member to desired Set.


    Keep trying

    Wednesday, February 19, 2014 12:21 PM
  • Take a look at the bulk update script in the script box: http://social.technet.microsoft.com/wiki/contents/articles/2168.how-to-use-powershell-to-bulk-update-the-value-of-an-attribute-for-a-certain-type.aspx

    It is an example of how to query FIM from PowerShell and update an attribute on all the records found. When you query FIM from PowerShell you use a special query syntax that is similar to XPath. The bulk update script updates all records for a given object type by default. It is intended to update all People for example (and uses the query "/Person" to do this).

    What you could do is add an attribute in the FIM Service called "QueueSMS" or similar. Next create a Transition-In MPR / workflow that sets the QueueSMS attribute to "Yes" when a user transitions into your set of people whose password is about to expire. You would next modify the query in the Bulk Import script to be /Person[QueueSMS="Yes"] - This would pull back just the users that have been determined to need notification.

    Now you can run the script whenever you want and you get a list of users that need notification. You would have the script set the QueueSMS attribute to "No" so that you don't repeat the notification. (The Bulk Import script already has the code to do this - it sets an attribute to a value)

    All that is left is to extend the script to send the actual SMS, or to update some other attribute on your user that in turn would trigger your workflow that sends the SMS.



    • Edited by Rex Wheeler Friday, February 21, 2014 7:12 AM Correct Typo
    • Marked as answer by Johan Marais Friday, February 28, 2014 11:57 AM
    Thursday, February 20, 2014 6:56 PM
  • Hi,

    Thank you all for your contribution.  In the end it was the best option to use a PS script to set the value of an attribute on a user object.  In a nut shell this is what I did to achieve this.

    1. Added two attributes to the user object, something like ReadySMS and DelaySMS

    2. I have a Set of which a user becomes a member when his / her password is about to expire, we have three Sets, 1-day, 3-days and 5-days

    3. There is a MPR which executes a WF to set a value on the users in the password expiry Set ReadySMS=1.  The reason for this is that members of temporal Set can't be used in another Set and to narrow down the search scope of the PS script.

    4. At a specific time like  at 07h00 a PS script will run to set the other attribute of the users in the expiry Set to a value like DelaySMS=1

    5. The two values will result in the users becoming members of another Set which is used to trigger a MPR which will execute a WF to send a SMS and Email at the desired time. This WF also reset the two values to 0 - ready for the next cycle.

    The advantage of this method is that I don't have to change the schedule of the temporalEventsJob and this method can be used for other activities as well.  The disadvantage is that it is a bit of a complex setup and would need to be documented well.

    Thanks again for everybody which contributed ideas.

    Regards

    Johan Marais


    JkM6228

    Friday, February 28, 2014 12:13 PM
  • Hey,

    the easiest way to do this is to have a workflow with "Run on Policy Update" Checked.

    Then have a MPR that triggers the workflow on Set transiton.

    Then you can have a PowerShell script set on a schedule. All this script should do is disable and re-enable the MPR, this way the Workflow will fire as its a "Policy update".

    Rob


    Rob

    Wednesday, September 3, 2014 2:43 PM
  • Rob,

    Thanks for you reply.  Your solution is a little less complex than the way I have implemented it, will keep this in mind when we review our FIM solution.

    Regards

    Johan


    JkM6228

    Thursday, September 4, 2014 4:54 AM