Showing posts with label SfB. Show all posts
Showing posts with label SfB. Show all posts

Monday, May 18, 2020

Complex IVR Workflow

I recently encountered a use case, where I had to push the Skype for Business RGS Workflows to the limit. While I know there are "paid" software out there that can simplify the task. I thought I would write a script that can do the same thing (with some knowledge of P$).

The script is divided into three sections.


  1. The first section of this script is where you can make changes to put the Workflow parameters and customise the script for your environment.
  2. The second section is where the fun is; you will need to edit this based on the IVR questions and responses; edit this as you see fit; I have tried to include as much as possible in there.
  3. DO NOT EDIT the third section; as this retrieves the Workflow (or creates it); and updates it with the information from the first two sections.
I am looking for feedback; on this script; for now, it will do the job; but do people want to enter the information via a CSV ? JSON ? especially the IVR questions and responses section.

Download
v.0.1 - 2020.05.01 - Update-CsIvrWorkflow.ps1

Tuesday, July 4, 2017

The dreaded DCOM error

This one took weeks from me to figure out, and a little help from our friends at Microsoft. After upgrading a customer's SBA fron 2013 to SfB (and following the correct process):
  1. Move users to Front-End
  2. Remove SBA from topology
  3. Add SBA back into topology with the same name but under the SfB node
  4. Re-install SBA software using 2015 image
  5. Move users back to SBA
Number five is where the issue happened; the users would not move back with a DCOM error:

Interestingly enough, the error in the event log is even more confusing, talking about RoutingGroup already assigned to a different pool (EventID:32209):

Since this is a weird error, the fix will have to be even more weird; this fix is from MS internal documentation :-) (DISCLAIMER: I take no responsibility for doing this on your own environment)
You will need to run the below command to find the users that have a conflicting routing group ID with the one in the Error message:
(Get-CsPool FE01.contoso.com).Computers | `
    % {Sqlcmd.exe -E -S $_\rtclocal -d rtc -Q `
    "select UserAtHost,* from dbo.RoutingGroupAssignment as rga `
    inner join dbo.ServiceCluster as sc on (sc.ServiceClusterId = rga.ServiceClusterId) `
    inner join dbo.ServiceAssignment as sa on (sa.ServiceTagId = sc.ServiceTagId) `
    inner join dbo.Pool as p on (p.PoolId = sa.UscClusterId) `
    inner join dbo.ResourceDirectory as ResD on (ResD.RoutingGroupId = rga.RoutingGroupId) `
    inner join Resource as Res on (Res.ResourceId = ResD.ResourceId) `
    where rga.RoutingGroupName = '<BAD ROUTING GROUP ID>'" -W -s "," -o $_-dumpuserinRG.csv}

The output file will have several users for that routing group ID that are considered "defective"; you will need to run the next command from the RTC database on ALL FE servers in the pool:
use rtc
go
exec [RtcDeleteResource] 'user@domain.com'
go

Rinse and Repeat ... for all Routing Group IDs that show up in the error message.
Now the move user works !!!

Monday, July 18, 2016

Phone Number Mismatch

I have been at many sites where the phone numbers on the AD contact is not the same as what is configured on Lync/SfB (Skype for Business).

Since SfB is the single source of truth when it comes to which number the user will ultimately answer on; I have devised a quick script that will match those two numbers up, and make sure that all AD contacts that have a Lync/SfB account have the correct phone number associated with them.

Hope this helps a few people out there...

P.S. This script can be easily modified to make other changes to contacts as required.


Download
v.0.1 - 2016-07-18 -Invoke-CsNumberMatch.v.0.1.zip

Friday, June 3, 2016

Sonus SBC Call Actions

I haven't found a place that explains the real life use case for this; so I thought I would write one for anyone that may search one day for how to do this.

I usually use this as a first step in the call flow, to manipulate the call before it gets to the routing stage.

As a simple example (don't want to get too complicated here). Let's say you want to mask certain caller IDs based on the "department" field in AD.

First thing, you need to setup the AD integration (lots of details on Google about how to do this), and make sure you synchronise (or otherwise leave it set to online) the AD attributes:

  • msRTCSIP-Line
  • department
Once you have got that working, you should create a manipulation table that will make the required changes to your call based on certain rules. In our case, it should check the "department" field and change the CallingNumber based on that.


Next an "Action" needs to be created to direct the call flow. In our example, we need to call to continue down its path regardless of the outcome.


This action will need to be used in an "Action Set" to modify the call flow. Again, in this case, we will allow the call to continue down the same path regardless. Quick gotcha here, the "Continue" option in the "Action Set" does not mean continue the call; it means continue the processing of the rules, so if you put "Continue" the call will fail...


Finally, you need to apply this "Action Set" to a signalling group for it to take affect. In our case, we will apply it to the "To/From SfB" so that it will be intercepted before the call is made out to the PSTN...


Wednesday, May 25, 2016

Last Login Timestamp

Ok ... here is one that I have used with some of my customers to clean up their user database ...

This script will go through a pool or all the pools in the deployment and check the last login timestamp for all the users that have logged in to each of the member servers (or SBAs).

You can use the -Unique switch to get only the latest login or drop the switch to get all timestamps available in the deployment.

You have also the option of producing the results in a Grid format, or a CSV file. Alternatively, do not specify any output format, and the result will be an array of objects that you can use to pipe into other commands.

If you get an error reading from the SQL database, you might not have access to that server's RTCLocal database; or you may need to open the correct ports (check out the infamous Get-CsConnections.ps1 script by Pat Richard on how to do that).

Hope this helps, and as always your feedback is highly appreciated.

Download
v.0.01 - 2016-05-25 - Get-CsUserLastLogin.v.0.01.zip

Wednesday, January 13, 2016

New Year ... New Holiday Lists

Since its the new year, and everyone is updating their RGS holiday lists, I thought I would contribute with a quick one-liner to help all those who want to quickly view which RGS groups have what holiday lists (you would think Microsoft would make that easier for you).

$Workflows = get-CsRGSWorkflow
$Holidays = @()

foreach($Workflow in $Workflows){

   $List = @($Workflow.HolidaySetIDList)
   $S = ""
   if ($List){
     $S = [string]::Join(", ",($List |%{$Holiday = $_;Get-CsRgsHolidaySet -ShowAll|?{$_.Identity -match $Holiday.InstanceId}}).Name)
   }
   $Workflow |Add-Member "HolidaySet" $S
   $Holidays += $Workflow |Select-Object Name,LineURI,Language,TimeZone,HolidaySet
}

return $Holidays

Monday, September 7, 2015

Lync/SfB Disabled your AD Disabled Users

I have noticed this with many customers I have visited. Their off-boarding process usually misses disabling the user from Lync/SfB.

The end result is that users being disabled in AD are still active and visible in Lync/SfB; this also has licensing implications, especially with today's O365 licensing and auditing. Add to that, the DID number assigned to the user will still be in use and will not be freed up.

I came up with this script that will quickly go through the AD/SfB environment and spit-out (or also disable) all users that are already disabled in AD.

Download
v.0.01 - 2015-09-06 - Get-CsDisabledUsers.v.0.01.zip
v.0.02 - 2016-05-17 - Get-CsDisabledUsers.v.0.02.zip