none
Normalize phone number in FIM RRS feed

  • Question

  • What's the best way to normalize a phone number in FIM? Phone number now appears as +15141234567#1234567, i want to change it to +1-514-123-4567 #1234567. It's quite easy to do with powershell, but I'm not able to do it with FIM.

    I've created a custom workflow from a powershell script. I've also created a MPR triggered by Add, Create, Modify, Read, Remove. When i edit a user manually, i get the followign error:

    <RequestStatusDetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" DetailLevel="Information" EntryTime="2015-12-09T14:32:55.7203536Z">System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
       at System.ThrowHelper.ThrowKeyNotFoundException()
       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at Microsoft.ResourceManagement.Query.QueryParametersGenerator.WriteRequestedAttributes()
       at Microsoft.ResourceManagement.Query.QueryParametersGenerator.BuildParameterString()
       at Microsoft.ResourceManagement.Query.QueryProcessor.BuildSqlCommand(Query objectRepresentation, Boolean countResultsOnly)
       at Microsoft.ResourceManagement.Query.QueryProcessor.ExecuteQuery(Query query, Nullable`1 maximumTime, Boolean&amp; endOfSequence, Boolean countResultsOnly, Int64&amp; resultCount, Int64&amp; executionTime)
       at Microsoft.ResourceManagement.Data.DataAccess.GetObject(Guid objectId, CultureInfo locale, Guid requestor, String[] attributeNames, Boolean includeInlineRights)
       at Microsoft.ResourceManagement.Data.DataAccess.GetObject(Guid objectId, String[] attributeNames)
       at Microsoft.ResourceManagement.ActionProcessor.ActionDispatcher.Read(Guid objectId, CultureInfo locale, Nullable`1 requestor, Nullable`1 resourceTime, String[] requestedAttributes, Boolean includeRights)
       at Microsoft.ResourceManagement.ActionProcessor.ActionDispatcher.ProcessOutputRequest(RequestType request)
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteGetAction(RequestType request)
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction(RequestType request)
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction[ResponseBodyType](RequestType request)
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request, Guid requestIdentifier, Object redispatchSingleInstanceKey, Boolean isRedispatch)
       at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request)
       at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.DispatchRequest[TResponseType](RequestType request, Boolean applyAuthorizationPolicy)
       at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessGetWorkItem(ReadRequestWorkItem readWorkItem)
       at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessWorkItem(WorkItem workItem)</RequestStatusDetail>
    ------------------------------------------------------------

    Is it the good way to it, should I use a synchronisation rule instead of a workflow?

    Thanks

    Pierre-Nicolas

    Wednesday, December 9, 2015 3:20 PM

Answers

  • I suspect the error you're getting is because attribute names are case sensitive. You should be setting [//Target/TelephoneNumber]. Note the capital T.

    Thanks,
    Brian

    Consulting | Blog | AD Book

    • Marked as answer by Pierre-Nicolas Tuesday, December 15, 2015 9:27 PM
    Monday, December 14, 2015 4:24 PM
    Moderator

All replies

  • Hi Pierre-Nicolas,

    I would also use a powershell activity for this, so yes a workflow should do fine!

    Looking at your error, this gets my attention "The given key was not present in the dictionary.". This looks like you are not able to succesfully fetch your original phone number from the workflow dictionary.

    You can try this in your powershell script if you are using the powershell activity from fimpowershellwf.codeplex.com:

    # Fetch phone number from workflow dictionary
    $phoneNumber = $fimwf.WorkflowDictionary['phone']
    
    # do your normalization
    ...
    
    # Push the new value back to the workflow dictionary
    $fimWF.WorkflowDictionary.Add('phone', $phoneNumber)

    Hope this helps!


    Wouter Landuyt | IS4U FIM/MIM Expert Blog: blog.is4u.be

    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. Thank you!


    • Edited by Wouter L Wednesday, December 9, 2015 3:40 PM
    Wednesday, December 9, 2015 3:39 PM
  • Thanks Wouter,

    before I try with the custom activities, can you tell ne what wrong with the following workflow:

    Thank you !

    Pierre-Nicolas

    Wednesday, December 9, 2015 6:13 PM
  • It looks correct, but I don't recognize the custom workflow you are using. Where did you get it from?

    The Powershell-workflow on Codeplex does the same thing, but you will have to use the "Function Evaluator" workflow to save attributes from the workflow dictionary to the target attributes.

    Good luck!


    Wouter Landuyt | IS4U FIM/MIM Expert Blog: blog.is4u.be

    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. Thank you!

    Thursday, December 10, 2015 12:02 PM
  • I suspect the error you're getting is because attribute names are case sensitive. You should be setting [//Target/TelephoneNumber]. Note the capital T.

    Thanks,
    Brian

    Consulting | Blog | AD Book

    • Marked as answer by Pierre-Nicolas Tuesday, December 15, 2015 9:27 PM
    Monday, December 14, 2015 4:24 PM
    Moderator
  • It looks correct, but I don't recognize the custom workflow you are using. Where did you get it from?

    The Powershell-workflow on Codeplex does the same thing, but you will have to use the "Function Evaluator" workflow to save attributes from the workflow dictionary to the target attributes.

    Good luck!


    Wouter Landuyt | IS4U FIM/MIM Expert Blog: blog.is4u.be

    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. Thank you!


    It's the FIMWAL which is available through services engagements with Microsoft Consulting Services.

    Thanks,
    Brian

    Consulting | Blog | AD Book

    Monday, December 14, 2015 4:24 PM
    Moderator
  • Yes, there was a case issue, in both WorkflowData and Target. The name was not the same in the metaverse neither.

    There was also a missing configuration in the management agent, telephoneNumber was exported but not imported in the metaverse. Thank you all for your answers.

    Tuesday, December 15, 2015 9:26 PM