Lync – Change queue overflow number with PowerShell Script

The scenario is you have created a Response Group (IVR) with an option to call an Out Of Hours engineer.  You configure a queue overflow to forward straight to a mobile telephone number outside of your organisation as follows:


The out of hours engineer changes on a rota and you want staff to be able to change the queue overflow number without giving them having to access the Lync Control Panel.  I have created a PowerShell script that allows users to accomplish this.  They can select from a list of names in the menu or manually type a number.  Any changes are logged to a text file.


Here is the script:


Users need to be a member of CSResponseGroupAdministrator and have the Lync Admin Tools installed.  However, in my environment I have created a service account and used psexec to publish the script via Citrix (The Citrix server has the Lync Admin Tools installed).

c:\scripts\psexec.exe -e -u domain\RGSSVCAccount -p password C:\Windows\System32\Windows\PowerShellv1.0\powershell.exe -noexit “C:\Scripts\LyncScripts\Lync_QueueOverflow.ps1”


3 Replies to “Lync – Change queue overflow number with PowerShell Script”

  1. Thank you for the script! I changed line 63 as we use a timeout instead of overflows

    $x.TimeoutAction = New-CsRgsCallAction -Action TransferToUri -Uri $forwardto

    I added the admin user accounts to CSResponseGroupAdministrator but am getting the following error when running remotely (it works fine directly on the pool server):
    Get-CsRgsQueue : Cannot open database “rgsconfig” requested by the login. The login failed.
    Login failed for user ‘DOMAIN\user.

    Do you have any suggestions?


Leave a Reply

Your e-mail address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.