The generalised Workflow Activity Library for Microsoft Identity Manager (MIMWAL) is not particularly new, but I’m regularly finding new ways of using it.
TL;DR: [//Queries/Key/Attribute] can be used as a target to update multiple accounts at once
Working from colleague Michael’s previous post Introduction to MIM Advanced Workflows with MIMWAL (Update Resource workflow section), user accounts can be populated with location details when a location code is set or updated.
But, consider the question: what happens when the source location object is updated with new details, without moving the user between locations? A common occurrence is when the building name/number/street changes due to typing errors. New accounts and accounts moved into the location have the updated details, but accounts already in the location are stuck with old address details. The same can also occur with department codes and department names, or a number of other value->name mappings.
This is a scenario I’ve seen built poorly several times, with a variety of external script hackery used to address it, if it is addressed at all, and I’m here to say the MIMWAL makes it ridiculously easy. If you don’t have the MIMWAL deployed into your MIM (or FIM) environment, I seriously recommend doing so – it will repay the effort taken to build and deploy very quickly (Check the post above for build/deploy notes).
Mass Updates Solution
All it takes with MIMWAL, is one workflow, containing just activity, paired with a policy rule (not documented here).
Start a new workflow definition:
- Name: Update all people in location when Location is updated
- Type: Action
- Run on policy update: False
Add Activity -> Activity Picker -> “WAL: Update Resources” -> Select
You’ll have to tick Advanced Features, then tick Query Resources when revealed to be able to enter the query.
Here, we’re searching for all person objects which have their location reference set to the location object which has just been updated. If you’re not using location references, you could use a search such as “/Person[_locationCode = ‘[//Target/_locationCode]’]” instead.
- Advanced Features: True
- Query Resources: True
- Key: Users
- XPath Filter: /Person[_locationObject = ‘[//Target/ObjectID]’]
Here is where the magic happens. I haven’t found many examples on the web; hopefully this makes it more obvious how updating multiple objects at a time works.
The target expression is the result set from the above query, and the particular attribute required. In this example, we’re collecting the Address attribute from the updated location object ([//Target/Address]) if it exists, or null otherwise, and sending it to the Address attribute on the query result set called Users ([//Queries/Users/Address]).
- Value Expression: IIF(IsPresent([//Target/Address]),[//Target/Address],Null())
- Target: [//Queries/Users/Address]
- Allow Null: True
and so on, for all appropriate attributes.
Very simple to set up, but can be slow to execute across large result sets as each object (e.g. Person) is updated as a separate request, so try to make changes to location data in quiet processing times, or on an admin service instance … but you do that anyway, right?