Lync Server 2010/2013 Response Group Holiday Sets

I recently performed a Lync Server 2010 deployment for an organisation with a branch office in Aberdeen, Scotland. As their bank holidays vary slightly in comparison to England and Wales, I created a Response Group Holiday Set for Scotland. The original script layout credit goes to UnifiedMe, which you can find here.

1. Connect to your Microsoft Lync Server 2010/2013 front end server.

2. Open the Microsoft Lync Server Management Shell and paste the following contents in its entirety. Prior to doing so, enter the FQDN of your front end pool in the “ApplicationServer” section before running the command.

 $a = New-CsRgsHoliday -StartDate “06/05/2013 12:00 AM” -EndDate “07/05/2013 12:00 AM” -Name “2013 Early May”
$b = New-CsRgsHoliday -StartDate “27/05/2013 12:00 AM” -EndDate “28/05/2013 12:00 AM” -Name “2013 Spring”
$c = New-CsRgsHoliday -StartDate “05/08/2013 12:00 AM” -EndDate “06/08/2013 12:00 AM” -Name “2013 Summer”
$d = New-CsRgsHoliday -StartDate “02/12/2013 12:00 AM” -EndDate “03/12/2013 12:00 AM” -Name “2013 St Andrew’s Day”
$e = New-CsRgsHoliday -StartDate “26/12/2013 12:00 AM” -EndDate “27/12/2013 12:00 AM” -Name “2013 Boxing Day”
$f = New-CsRgsHoliday -StartDate “25/12/2013 12:00 AM” -EndDate “26/12/2013 12:00 AM” -Name “2013 Christmas Day”
$g = New-CsRgsHoliday -StartDate “01/01/2014 12:00 AM” -EndDate “02/01/2014 12:00 AM” -Name “2014 New Years Day”
$h = New-CsRgsHoliday -StartDate “02/01/2014 12:00 AM” -EndDate “03/01/2014 12:00 AM” -Name “2014 2nd January”
$i = New-CsRgsHoliday -StartDate “18/04/2014 12:00 AM” -EndDate “19/04/2014 12:00 AM” -Name “2014 Good Friday”
$j = New-CsRgsHoliday -StartDate “05/05/2014 12:00 AM” -EndDate “06/05/2014 12:00 AM” -Name “2014 Early May”
$k = New-CsRgsHoliday -StartDate “26/05/2014 12:00 AM” -EndDate “27/05/2014 12:00 AM” -Name “2014 Spring”
$l = New-CsRgsHoliday -StartDate “04/08/2014 12:00 AM” -EndDate “05/08/2014 12:00 AM” -Name “2014 Summer”
$m = New-CsRgsHoliday -StartDate “01/12/2014 12:00 AM” -EndDate “02/12/2014 12:00 AM” -Name “2014 St Andrew’s Day”
$n = New-CsRgsHoliday -StartDate “26/12/2014 12:00 AM” -EndDate “27/12/2014 12:00 AM” -Name “2014 Boxing Day”
$o = New-CsRgsHoliday -StartDate “25/12/2014 12:00 AM” -EndDate “26/12/2014 12:00 AM” -Name “2014 Christmas Day”
$p = New-CsRgsHoliday -StartDate “01/01/2015 12:00 AM” -EndDate “02/01/2015 12:00 AM” -Name “2015 New Years Day”
$q = New-CsRgsHoliday -StartDate “02/01/2015 12:00 AM” -EndDate “03/01/2015 12:00 AM” -Name “2015 2nd January”
$r = New-CsRgsHoliday -StartDate “03/04/2015 12:00 AM” -EndDate “04/04/2015 12:00 AM” -Name “2015 Good Friday”
$s = New-CsRgsHoliday -StartDate “04/05/2015 12:00 AM” -EndDate “05/05/2015 12:00 AM” -Name “2015 Early May”
$t = New-CsRgsHoliday -StartDate “25/05/2015 12:00 AM” -EndDate “26/05/2015 12:00 AM” -Name “2015 Spring”
$u = New-CsRgsHoliday -StartDate “03/08/2015 12:00 AM” -EndDate “04/08/2015 12:00 AM” -Name “2015 Summer”
$v = New-CsRgsHoliday -StartDate “30/11/2015 12:00 AM” -EndDate “01/12/2015 12:00 AM” -Name “2015 St Andrew’s Day”
$w = New-CsRgsHoliday -StartDate “28/12/2015 12:00 AM” -EndDate “29/12/2015 12:00 AM” -Name “2015 Boxing Day”
$x = New-CsRgsHoliday -StartDate “25/12/2015 12:00 AM” -EndDate “26/12/2015 12:00 AM” -Name “2015 Christmas Day”
New-CsRgsHolidaySet -Parent ApplicationServer:servername.domain.local -Name “Scotland Bank Holidays” -HolidayList ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u,$v,$w,$x)

3. In the Lync Control Panel click “Response Groups” and then click to create or edit a workflow. Once the web site loads select the hunt or interactive response group that you need to apply the holiday set to and click edit. In the workflow editior under the “Specify Your Holidays” section you should now see the Response Group Holiday Set name displayed. Click to check the holiday set and the configure your preferred call routing method for the days contained within the created set and click Save at the bottom of the workflow once you have finished.

That’s it, the holiday set will now be active.

Lync Server 2010 – Client Recording Location

I recently had a requirement to store Lync 2010 recordings on a UNC path for a customer. Natively in Lync 2010, setting the recording location directly through the client to either a UNC path or a mapped drive is not supported, and there is a good reason as to why this is the case. When a Lync 2010 recording is invoked the data is streamed to the recording location and when the recording is stopped it is then processed and viewable in both the the Lync Recording Manager and as a WMV file if selected. If for example there was an interuption to network connectivity on the local client, this would impact the recording itself. If you do try and select a mapped drive as a recording location in the Lync 2010 client, the following error will be displayed.

Lync Recording Mapped Drive 300x104 Lync Server 2010   Client Recording Location

If you have a particular requirement to place Lync recordings onto a mapped drive, the following work around can be performed. This work around utilises a HKEY_CURRENT_USER registry modification that is executed every time a user logs onto a workstation, the registry key itself sets the “RecordingRootDirectory1″ value to be the mapped drive or UNC path that you require. In order achieve this, the following actions need to be performed.

1. Download the LyncRecordingLocation registry file from here.

2. Open the registry file in notepad and amend the “RecordingRootDirectory1″=”S:\\LyncRecordings\\” entry to read a mapped drive or UNC location of your choice and then save the file.

3. Connect to a domain controller in your infrastructure and then open the Group Policy Management Console. From here, create a new GPO named “Lync Recording Location” for example, and then right click the newly created object and select edit.

4. When the GPO Editor opens navigate to the following location, User Configuration -> Policies -> Windows Settings ->Scripts, as illustrated below.

Group Policy Object 300x123 Lync Server 2010   Client Recording Location

5. In the Scripts action pane, double click Logon to configure the script. When the Logon dialog box opens click Add which will invoke the “Add a script” dialog box. In the “Script Name” field type the following without quotes, “Regedit.exe”. In the parameters field enter the following without quotes “/s LyncRecordingLocation.reg”. See below for an illustration of this and once both of these fields have been populated click OK.

Logon Script Dialogue Box 270x300 Lync Server 2010   Client Recording Location

6. To complete the creation of the script, click the “Show Files” button and in the policies folder that then displays copy and then paste the LyncRecordingLocation.reg file into this area and close the window. Click Apply and the OK on the Logon Properties dialog box and then exit the Group Policy Management Editor.

7. Back in the Group Policy Management Console, locate an Organisational Unit (OU) where your Lync 2010 users reside, right click the OU and then select “Link an existing GPO” and then select the Lync Recording Location GPO that you have created. This could also be filtered to a specific Active Directory group that requires recordings to be stored centrally, choose which ever option is suitable for your environment.

8. Have your Lync 2010 users log off their workstations and back on again. Open the Lync 2010 client, select Options -> File Saving, and ensure that the Lync Recordings Save To dialog box is now showing the mapped drive or UNC path you set in the registry file, as illustrated below.

Lync Recordings Save To 300x45 Lync Server 2010   Client Recording Location

That’s it, the process is now complete.

Lync Server 2010 – Deleting User Contacts Via SQL

I recently experienced an issue at a customer whereby they had used the very helpful LyncAddContacts VBS script from the EXPTA blog, however this process had gone slightly wrong for the customer and they wanted to delete all contacts that had been pushed out to users and start again. Unfortunately the handy dbimpexp.exe tool does not allow you to explicitly delete contacts from users in bulk or individually. To get around this issue I utilised the following Microsoft SQL query against the Lync RTC database in order to delete a users contacts in their entirety. Please use the following information with caution, the query listed below modifies tables in the RTC database and should be used at your own discretion.

1. Using the Microsoft SQL Management Studio tools connect LyncServerName\RTC using an account that has full CSAdministrator rights.

2. When connected, under databases right click “RTC” and select “New Query”.

3. In the new query entry fieldtype the following:

DECLARE @RC int
DECLARE @_Owner nvarchar(4000)
EXECUTE @RC = [rtc].[dbo].[ImpDeleteContactGroups2] “user@sipdomain.co.uk
GO

4. Under the Execute command detailed above change the users SIP address to be the desired one. To run this for multiple people at once, add more Execute lines for each person and then click Execute in the tool bar to run the script
 
5. Once the query has run, log into the Lync 2010 client as the user(s) and ensure their contacts list is now blank.
 
That’s it, the process is complete.

Lync Server 2010 – ABSConfig Issue

I was recently using the ABSConfig.exe tool, which is a part of the Lync Server 2010 Resource Kit, to make some modifications to the address book for number normalisation. After playing around for a while I decided, to be safe, I would use the “Restore Defaults” button on the ABSConfig tool to put me back to where I started. Soon after clicking the button it appeared all was not well. I noticed that when querying users in the Lync 2010 client, that opposed to it showing a users given name, it was actually showing their job title. I also noticed that corporate photo graphs for new users, ones that were not in my clients ABS cache file, were not being displayed. It tuns out that the ABSConfig.exe tool in the Lync Resource Kit had been released by Microsoft still containing the OCS 2007 R2 database modification. Effectively, clicking Restore Defaults in the ABSConfig tool in a Lync front end server caused the RTC database to be overwritten with OCS attributes resulting in a pretty much destroyed address book.

I located a great blog post here, which provides an SQL query to restore the address book attributes in the RTC database back to Lync RTM. This worked great for name lookups but my corporate photographs would still not sync. After a weekend of investigating the issue, I decided to contact Microsoft Partner Support, who provided me with a SQL query that resolved all my address book and corporate photograph issues. The solution provided is detailed below:

1. On the standard edition server, or the server which holds the RTC database, install the Microsoft  SQL Server 2008 Management Studio and connect to the RTC database.

2. Click on “New Query” and paste the following SQL into the query window and click the execute button. The execute button is the small green “play” icon.

use rtc
exec dbo.RtcDeleteAbAttributes
exec dbo.RtcAddAbAttribute 1, N’givenName’, 0x01400000
exec dbo.RtcAddAbAttribute 2, N’sn’, 0x02400000
exec dbo.RtcAddAbAttribute 3, N’displayName’, 0x03420000
exec dbo.RtcAddAbAttribute 4, N’title’, 0x04000000
exec dbo.RtcAddAbAttribute 5, N’mailNickname’, 0x05400000
exec dbo.RtcAddAbAttribute 6, N’company’, 0x06000000
exec dbo.RtcAddAbAttribute 7, N’physicalDeliveryOfficeName’, 0x07000000
exec dbo.RtcAddAbAttribute 8, N’msRTCSIP-PrimaryUserAddress’, 0x08520C00
exec dbo.RtcAddAbAttribute 9, N’telephoneNumber’, 0x09622800
exec dbo.RtcAddAbAttribute 10, N’homePhone’, 0x0A302800
exec dbo.RtcAddAbAttribute 11, N’mobile’, 0x0B622800
exec dbo.RtcAddAbAttribute 12, N’otherTelephone’, 0x0C302000
exec dbo.RtcAddAbAttribute 13, N’ipPhone’, 0x0D302000
exec dbo.RtcAddAbAttribute 14, N’mail’, 0x0E500000
exec dbo.RtcAddAbAttribute 15, N’groupType’, 0x0F010800
exec dbo.RtcAddAbAttribute 16, N’Department’, 0x10000000
exec dbo.RtcAddAbAttribute 17, N’Description’, 0x11000100
exec dbo.RtcAddAbAttribute 18, N’manager’, 0x12040001
exec dbo.RtcAddAbAttribute 19, N’proxyAddresses’, 0x00500105
exec dbo.RtcAddAbAttribute 20, N’msExchHideFromAddressLists’, 0xFF000003

3. From the Lync Management Shell run the following command: Update-CsUserDatabase

4. Open up the servers event viewer and wait until you can see Lync events 30024, 30027 & 30028 before proceeding with the next step.

5. From the Lync Management Shell run the following command: Update-CsAddressBook and wait around ten minutes before proceeding with the next step.

6. Open a Lync 2010 client and wait for the address book to download, this should have now resolved all address book issues.

Thanks to Mike Halfacree at Microsoft UC Support for the resolution.

Lync Server 2010 – Audio Test Service Issue

I recently experienced an issue when attempting to check the audio quality from a Lync 2010 client. When clicking the “Check” button under the enterprise voice tab of the client, I was greeted with a “Call has not completed or has ended” error. After some investigation it turned out this had occurred due to the primary SIP domain being renamed after the Lync Server installation had been performed and as a result the Test Call auto attendant still had the old SIP domain appended to it. To resolve this issue the following actions were performed:

1. Log on to your Lync server and open the Lync Server Management Shell. When the Management Shell opens type in the following command without quotations, “Get-CSAudioTestServiceApplication” and press return. You should now be presented with a service output and the key part we are looking for is the following:

OwnerUrn: urn:application:testbot
SipAddress: sip:RtcApplication-0e0e407a-6283-4c93-99fa-c0e252b8af09@contoso.local

In my case, my primary SIP domain was no longer contoso.local, this was not even a secondary SIP domain. This ment that when attempting to perform a test call, the SIP address associated with the test bot could not be reached.

2. Now that you have confirmed the SIP address being used for the test call is incorrect, we can now look at a second section of the Get-CSAudioTestServiceApplication output in order to identify exactly what Active Directory attribute we need to modify. Under the identity section of the output you should see a similar string to the following:

Identity: CN={46577062-9cae-404b-b89c-a3d39511e4cc},CN=Application Contacts,CN=RTC Service,CN=Services,CN=Configuration,DC=contoso,DC=local

The CN={46577062-9cae-404b-b89c-a3d39511e4cc} attribute is the one which holds the SIP information for the test call bot. Now we know what attribute we need to modify, you can perform the following actions:

3. Logon to domain controller. From the Run dialog box type adsiedit.msc and click ok to open the ADSI Editor.

4. Right click ADSI Edit and then choose Connect To, and then select Configuration from the “Select a well known Naming Context list” and click ok.

5. Click on node CN={46577062-9cae-404b-b89c-a3d39511e4cc}, CN=Application Contacts, CN=RTC Service, CN=Service, CN=Configuration, DC=yourdomain, DC=local, and then right click this node and then select properties.

Note: Replace the “CN=46577062-9cae-404b-b89c-a3d39511e4cc” attribute that was identified in the Get-CSAudioTestServiceApplication output with the GUID for your organisation. The GUID’s specified are unquie to my Active Directory domain.

6. Choose the msRTCSIP-PrimaryUserAddress attributes, and change the domain part of value to sip:RtcApplication-0e0e407a-6283-4c93-99fa-c0e252b8af09@yourdomain.co.uk, opposed to your domain.local. Essentially the domain part of the attribute must match what ever your primary SIP domain is.

7. Log on to your Lync 2010 front end server and restart Audio Test Service. Once the service has been restarted, attempt a test call from Lync 2010 client.

That’s it, you should now be able to make test audio calls from Lync clients.