• Home
  • My Tools
  • Visio Stencils
  • Online Tools
  • PS Scripts
  • PS One Liners
  • Downloads
  • Product Review
  • About

Smarter Together

~ by I.M.H.O.

Smarter Together

Tag Archives: Scripts

Lync RGS Emergency Failover Script

04 Tuesday Nov 2014

Posted by Paul Bloem in Powershell Scripts, RGS

≈ 2 Comments

Tags

Powershell, Response Group, RGS, Scripts

Todays script was created as a result of unending fire drills 🙂

What happens to my Response Group Calls when we have to suddenly evacuate the building?

Since the environments I come across most refers here to the DDI’s called to reach said Response Groups I have come up with the simplest solution. Basically I have a Emergency Workflow preconfigured complete with announcement and destination.

The Script offers the administrator the option to select Y or N to activate or de-activate Emergency Workflow respectively. If selecting Y, the Script then lifts the DDI from the normal Response Group Workflow and assigns it to the Emergency Workflow. Selecting N reverts the DDI to its original Workflow.

<#    
    .NOTES
    ===========================================================================
     Created on:       04/11/2014 8:13 p.m.
     Created by:       Paul Bloem
     Blog:     UCSorted.com
     Twitter twitter.com/PaulB_NZ
     Filename:         
    ===========================================================================
    .DESCRIPTION
        This script takes a DDI assigned to a RGS Workflow and re-assigns it to a Emergency Workflow - and vice versa depending on the 
        menu selection. You will need a pre-configured 
        Emergency RGS Queue, Group and Workflow. For simplicity you can configure the Emergency Queue to overflow to a destination with
        a Threshold of 0 (meaning that any calls will overflow immediatly.
        You then have the choice on the Emergency Queue to deliver the calls to another SIP address, a PSTN number (such as a cell phone)
        or to a UM enabled mailbox (Voicemail).
#>
# Script Config
Import-Module Lync
#The following Variables need to be manually edited to match your environment
$RGSWorkflow = "Support Workflow"                                    #RGS Workflow you want to failover
$RGSWorkflowDDI = "tel:+123456789"                                    #Line URI of the RGS Workflow
$EmergencyWorkflow = "Emergency - Support Workflow"                    #Name of the Emergency Workflow
$sipdomain = "@ucsorted.com"                                         #Lync Sip Domain
$ServiceID = "service:ApplicationServer:lyncFEPool1.ucsorted.com"     #Lync front end pool identity
$logfile = "c:\RGSEmergency-log.txt"                                #Specify a log file for this script

# Menu
#The Menu items below are displayed as TXT for selection purpose only. Once selected the next section (Selection Logic) is engaged
cls

Write-Host "* Set Emergency state for" $RGSWorkflow "" -ForegroundColor Cyan
Write-Host " "
Write-Host "Select one of the following options (Y\N):"
Write-Host " "
Write-Host "Y - Activate Emergency RGS" -foregroundcolor Yellow
Write-Host "N - De-Activate Emergency RGS" -foregroundcolor Yellow
Write-Host " "
$a = Read-Host "Select Y or N: "
Write-Host " "

# Selection Logic to set DDI for RGS based on Menu Selection

switch ($a)
{
    Y {
        $ActiveWorkflow = $EmergencyWorkflow
        $DeactiveWorkflow = $RGSWorkflow
    }
    N {
        $ActiveWorkflow = $RGSWorkflow
        $DeactiveWorkflow = $EmergencyWorkflow
    }
}

#Removing DDI from Active RGS
$a = Get-CsRgsWorkflow -Identity $ServiceID -name $DeactiveWorkflow
$a.LineUri = ""
set-csrgsworkflow -Instance $a

#Assigning the DDI to new Active RGS
$b = Get-CsRgsWorkflow -Identity $ServiceID -name $Activeworkflow
$b.LineUri = $RGSWorkflowDDI
set-csrgsworkflow -Instance $b

# Write to log file
$date = Get-Date
Write-output "$date, $ActiveWorkFlow, $RGSWorkflow1DDI" | Out-File -append $logfile

Write-Host "Active RGS changed to: " -NoNewline
Write-Host $ActiveWorkFlow -ForegroundColor Green
Write-Host " "

Download script

Advertisement

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Skype (Opens in new window)
  • Click to email a link to a friend (Opens in new window)
  • Click to print (Opens in new window)

Like this:

Like Loading...

IMHO YouTube Channel

Follow Smarter Together on WordPress.com

Enter your email address to subscribe and receive notifications of new posts.

Join 674 other subscribers

Show your appreciation by donating

Archives

Category

ABS ABServer ADContacts Address Book AddressBook AddressBook Service Communicator contacts CX500 Devices DHCP DNS Edge Server Error Codes event id Exchange UM 2010 GAL Install Guide Lync 2013 Tools Lync Edge Lync Tools Microsoft Teams Monitoring Polycom Powershell Scripts Product Review QOS Quick Reference Guide Reskit RGS RTC Database SIP SIP Options Skype for Business Skype for Business Monitoring Skype for Business Tools SQL Teams TMG Tool Tools Troubleshoot Edge UC Sorted Tools UM Uncategorized Unified Messaging visio Visio Stencil voicemail

Blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • Smarter Together
    • Join 63 other followers
    • Already have a WordPress.com account? Log in now.
    • Smarter Together
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: