TL;DR Just Tell Me How to Edit Lync IVR from PowerShell

The previous article was a bit of a walkthrough on creating and modifying a Lync Interactive Response Group from the Lync Management Shell.  However, the meat of that and the reason it was written was really focused around how to modify an existing group.  The method to accomplish this isn’t clear at all if you’re just starting out and reading through TechNet.  As promised, here’s the short version for those who already know their way around.

To modify a workflow, we first need to pull it into a variable like so:

$workflow = Get-CsRgsWorkflow -Name “Our IVR”

To review settings, we can drill down into the object a bit at a time.  For example, we can see what the DefaultAction of the workflow is by typing $workflow.DefaultAction.  We see that the action is TransferToQuestion and there’s a Question attribute.  So now we can drill into the question attribute by typing $workflow.DefaultAction.Question.  We can also see there’s an AnswerList attribute, which is an array of answers.  We can access that array directly by specifying $workflow.DefaultAction.Question.AnswerList.


You’ll notice that the AnswerList is a variable, and we can access it as such.  To get at a specific answer we can use $workflow.DefaultAction.Question.AnswerList[2] the same way we’d access any array in PowerShell.


We can add responses by $workflow.DefaultAction.Question.AnswerList.Add($YourNewAction).  This allows us to drill down deeper into the new answer the same way.  In the example below, you can see me getting at an answerlist that is an option from a previous answer.


To remove an answer, you’d use AnswerList.Remove() and specify which answer in the array you’d like to remove as seen here: $workflow.DefaultAction.Question.AnswerList.Remove($workflow.DefaultAction.Question.AnswerList[1]).

So far, we’ve only modified our $workflow variable, to write our changes back, we only need to type: Set-CsRgsWorkflow $workflow and we’re done!

Thanks for reading!

7 thoughts on “TL;DR Just Tell Me How to Edit Lync IVR from PowerShell

  1. Pingback: NeWay Technologies – Weekly Newsletter #106 – July 31, 2014 | NeWay

  2. Pingback: NeWay Technologies – Weekly Newsletter #106 – August 1st, 2014 | NeWay

  3. milad amiri

    i really thank you for this article.
    i have a Q,is there any way to set any kind of responce for invalid inputs ?
    for ex. we have only 2 option pressing 1,2 ,now is there any way to set prompt for another inputs ?

    1. C. Anthony Caragol Post author

      I’m unaware of a way to set a response for invalid input, someone correct me if I’m wrong. I suppose you could create an invalid response queue and populate all the other numbers, the queue would play a message, but the trick would be getting back to where you were. That could get messy. This is one of those spots that full contact center solutions can handle.

      1. Mike

        You can use the following switches for invalid and timeouts:
        -InvalidAnswerPrompt $Promptx
        -NoAnswerPrompt $Prompty

        Obvioiusly declaring the variables first.

        1. C. Anthony Caragol Post author

          And now I feel stupid… 🙂 Thank you Mike for clearing that up and adding your expertise! I apologize for answering too quickly without doing the homework on that one. Great information and something I should be leveraging myself in my deployments.

Comments are closed.