How to configure Lync 2013 QoS

This is the way that I did it. You may not want to use the same ports, but they’re the standard ones mentioned on Technet. Also I’m aware that you can push out the registry setting via GPO so I’ll leave you to sort that bit out.

Lets go…..

Configuring Port Ranges for Your Conferencing, Application, and Mediation Servers

To implement Quality of Service, you should setup the same port ranges for audio, video, and application sharing on your Conferencing, Application, and Mediation servers.

Property

Conferencing Server

Application Server

Mediation Server

AudioPortStart

49152

49152

49152

AudioPortCount

8348

8348

8348

VideoPortStart

57501

VideoPortCount

8034

ApplicationSharingPortStart

49152

ApplicationSharingPortCount

16383

 

Configuring a Quality of Service Policy for Your Conferencing, Application, and Mediation Servers

 

  1. In Group Policy Management, locate the container where the new policy should be created. For example, if all your Lync Server computers are located in an OU named Lync Server then the new policy should be created in the Lync Server OU.
  2. Right-click the appropriate container and then click Create a GPO in this domain, and Link it here.
  3. In the New GPO dialog box, type a name for the new Group Policy object in the Name box (for example, Lync Server QoS) and then click OK.
  4. Right-click the newly-created policy and then click Edit.
  5. In the Group Policy Management Editor, expand Computer Configuration, expand Policies, expand Windows Settings, right-click Policy-based QoS, and then clickCreate new policy.
  6. In the Policy-based QoS dialog box, on the opening page, type a name for the new policy (e.g., Lync Server QoS) in the Name box. Select Specify DSCP Value and set the value to 46. Leave Specify Outbound Throttle Rate unselected, and then click Next.
  7. On the next page, make sure that All applications is selected and then click Next. This simply ensures that all applications will match packets from the specified port range with the specified DSCP code.
  8. On the third page, make sure that both Any source IP address and Any destination IP address are selected and then click Next. These two settings ensure that packets will be managed regardless of which computer (IP address) sent those packets and which computer (IP address) will receive those packets.
  9. On page four, select TCP and UDP from the Select the protocol this QoS policy applies to dropdown list. TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the two networking protocols most-commonly used by Lync Server and its client applications.
  10. Under the heading Specify the source port number, select From this source port or range. In the accompanying text box, type the port range reserved for audio transmissions. For example, if you reserved ports 49152 through ports 57500 for audio traffic enter the port range using this format: 49152:57500. Click Finish.

 

Do the same for Video but set DSCP to 34 and use ports 57501:65535.

Again for Application sharing, DCSP 24 and ports 40803:49151.

Here’s what it should look like:

Apply the new GPO to your Lync 2013 servers and run gpupdate/force on the Lync servers to apply them or wait for them to apply automatically.

Apply this registry setting to ensure that Windows obeys the QoS settings.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\QoS]

“Do not use NLA”=”1”

If your QoS is being applied correctly you will see the following entries in the Registry on your Lync servers.

 

Configuring Port Ranges for Your Edge Servers

 

Packet Type

Starting Port

Number of Ports Reserved

Application sharing

40803

8348

Audio

49152

8348

Video

57500

8034

Totals

24730

 

This will configure all Edge servers to use the above range of ports.

Get-CsService -EdgeServer | ForEach-Object {Set-CsEdgeServer -Identity $_.Identity -MediaCommunicationPortStart 40803 -MediaCommunicationPortCount 24730}

 

 

Configuring a Quality of Service Policy for Your A/V Edge Servers

  1. Click Start and then click Run.
  2. In the Run dialog box, type gpedit.msc and then press ENTER.
  3. In the Group Policy Management Editor or the Local Group Policy Editor, expand Computer Configuration, expand Policies, expand Windows Settings, right-clickPolicy-based QoS, and then click Create new policy.
  4. In the Policy-based QoS dialog box, on the opening page, type a name for the new policy (e.g., Lync Server Audio) in the Name box. Select Specify DSCP Value and set the value to 46. Leave Specify Outbound Throttle Rate unselected, and then click Next.
  5. On the next page, make sure that All applications is selected and then click Next. This setting instructs the network to look for all packets with a DSCP marking of 46, not just packets created by a specific application.
  6. On the third page, make sure that both Any source IP address and Any destination IP address are selected and then click Next. These two settings ensure that packets will be managed regardless of which computer (IP address) sent those packets and which computer (IP address) will receive those packets.
  7. On page four, select TCP and UDP from the Select the protocol this QoS policy applies to dropdown list. TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the two networking protocols most-commonly used by Lync Server and its client applications.
  8. Under the heading Specify the destination port number, select From this destination port or range. In the accompanying text box, type the port range reserved for audio transmissions. For example, if you reserved ports 49152 through ports 57500 for audio traffic then enter the port range using this format: 49152:57500. Click Finish.

Do the same for Video but set DSCP to 34 and use ports 57501:65535.

Again for Application sharing, DCSP 24 and ports 40803:49151.

Apply this registry setting to ensure that Windows obeys the QoS settings.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\QoS]

“Do not use NLA”=”1”

 

Configuring Port Ranges for Your Microsoft Lync Clients

 

Client Traffic Type Port Start Port Range
Audio 50020 20
Video 58000 20
Application sharing 42000 20
File transfer 42020 20

 

Enabled client media ports and set them to the above:

Set-CsConferencingConfiguration -ClientMediaPortRangeEnabled $True -ClientAudioPort 50020 -ClientAudioPortRange 20 -ClientVideoPort 58000 -ClientVideoPortRange 20 -ClientAppSharingPort 42000 -ClientAppSharingPortRange 20 -ClientFileTransferPort 42020 -ClientFileTransferPortRange 20

 

Configuring Quality of Service Policies for Clients Running on Windows 7 or Windows 8

 

  1. In Group Policy Management, locate the container where the new policy should be created. For example, if all your client computers are located in an OU named Clients then the new policy should be created in the Client OU.
  2. Right-click the appropriate container and then click Create a GPO in this domain, and Link it here.
  3. In the New GPO dialog box, type a name for the new Group Policy object in the Name box (for example, Lync Audio) and then click OK.
  4. Right-click the newly-created policy and then click Edit.
  5. In the Group Policy Management Editor, expand Computer Configuration, expand Policies, expand Windows Settings, right-click Policy-based QoS, and then clickCreate new policy.
  6. In the Policy-based QoS dialog box, on the opening page, type a name for the new policy (e.g., Lync Audio) in the Name box. Select Specify DSCP Value and set the value to 46. Leave Specify Outbound Throttle Rate unselected, and then click Next.
  7. On the next page, make sure that All applications is selected and then click Next. This setting instructs the network to look for all packets with a DSCP marking of 46, not just packets created by a specific application.
  8. On the third page, make sure that both Any source IP address and Any destination IP address are selected and then click Next. These two settings ensure that packets will be managed regardless of which computer (IP address) sent those packets and which computer (IP address) will receive those packets.
  9. On page four, select TCP and UDP from the Select the protocol this QoS policy applies to dropdown list. TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the two networking protocols most-commonly used by Lync Server and its client applications.
  10. Under the heading Specify the source port number, select From this source port or range. In the accompanying text box, type the port range reserved for audio transmissions. For example, if you reserved ports 50020 through ports 50039 for audio traffic enter the port range using this format: 50020:50039. Click Finish.

Do the same for Video but set DSCP to 34 and use ports 58000:58019.

Again for Application sharing, DCSP 24 and ports 42000:42019.

Finally for File Transfers, DCSP 14 and ports 42020:42039.

 

Apply this registry setting to ensure that Windows obeys the QoS settings.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\QoS]

“Do not use NLA”=”1”

 

Switch and Firewall QoS

There no use setting all this up if your switches and firewall aren’t configured in the same way, or at least to preserve and adhere to the settings you’ve set.

QoS & the Internet

Hah. Good luck with that.

Advertisements

Lync 2013 Front End Service Fails to Start

After installing Lync 2013 the front end service may fail to start. I got the following error:

Log Name: Lync Server
Source: LS User Services
Event ID: 32178
Task Category: (1006)
Level: Error
Keywords: Classic
User: N/A
Computer: lync.jrw.local
Description:
Failed to sync data for Routing group {5A65CDB2-3DB5-5C72-9E7D-416A09E3FB97} from backup store.

Cause: This may indicate a problem with connectivity to backup database or some unknown product issue.

Resolution:
Ensure that connectivity to backup database is proper. If the error persists, please contact product support with server traces.

This looked like the fix: http://support.microsoft.com/kb/2795828/en-us

Had to remove all non root certificates from the trusted root certificates store. However after removing them all and rebooting for good measure I was still unable to start the front end service.

Should have known really.. Run windows updates and install the Lync 2013 cumulative updates kb 2809243 package from here and you’ll be golden.

Lync 2013 Cumulative updates http://www.microsoft.com/en-us/download/details.aspx?id=36820

Installing the Lync 2010 Monitoring Role

Quick and dirty post.. sorry.

When installing the Lync monitoring role, if you receive an error like the following:

Running script: C:\Windows\system32\cscript.exe //Nologo "C:\Program Files\Common Files\Microsoft Lync Server 2010\DbSetup\RtcCdrDbSetup.wsf" /dbexists /sqlserver:thegid-lync.thegid.local\MONITORING /serveracct:thegid\RTCComponentUniversalServices /logsize:1024 /verbose
 ---------------
 Installed SQL Server 2005 Backward Compatibility version is 8.05.2312
 Connecting to SQL Server on thegid-lync.thegid.local\MONITORING
 Error connecting (
 name: Error
 description:
 number: -2147221504
 message:
 )
 Attempting to start SQL Server and connect...
 Error starting SQL Server on thegid-lync.thegid.local\MONITORING
 Error (
 name: Error
 description:
 number: -2147023840
 message:
 )
 Ensure that thegid-lync.thegid.local\MONITORING is a valid SQL instance.
 ---------------
 Exit code: ERROR_START_SQLSERVICE (-1)
 When running /dbexists, non-zero exit codes are not necessarily errors
 ---------------
Running script: C:\Windows\system32\cscript.exe //Nologo "C:\Program Files\Common Files\Microsoft Lync Server 2010\DbSetup\RtcCdrDbSetup.wsf" /sqlserver:thegid-lync.thegid.local\MONITORING /serveracct:thegid\RTCComponentUniversalServices;"RTC Component Local Group" /dbpath:C:\CsData\MonitoringStore\MONITORING\dbpath /logpath:C:\CsData\MonitoringStore\MONITORING\logpath /logsize:1024 /verbose
 ---------------
 Installed SQL Server 2005 Backward Compatibility version is 8.05.2312
 Connecting to SQL Server on thegid-lync.thegid.local\MONITORING
 Error connecting (
 name: Error
 description:
 number: -2147221504
 message:
 )
 Attempting to start SQL Server and connect...
 Error starting SQL Server on thegid-lync.thegid.local\MONITORING
 Error (
 name: Error
 description:
 number: -2147023840
 message:
 )
 Ensure that thegid-lync.thegid.local\MONITORING is a valid SQL instance.
 ---------------
 Exit code: ERROR_START_SQLSERVICE (-1)
 ---------------

Open SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for <SQL instance> and ensure that TCP/IP is enabled. Restart the SQL instance after enabling it.

Also if you have issues running the “Deploy Monitoring Server Reports” open Reporting Services Configuration Manager > Web Service URL and ensure that you are able to browse to the Report Server Web Service URL.

Cannot insert duplicate key row in object ‘dboAgents’ with unique index ‘IX_Agents_UserSid’

Capture

Lync server 2010 admin? Read on…

If you need to move a user from one Response Group to another you may well encounter the following error message….

lync 2010 response group

Don’t worry, just check the event viewer on the Lync server for the following event:

lync server event

Once you see that event you can add the user to the other response group.

That’s it.

Exchange 2010 Outlook Web App and Lync Server 2010 Integration

 Quick and dirty guide to get Lync working in Exchange 2010 Web App

1. Download and install the following components

On Exchange 2010 CAS

Note: If any other Unified Communications Managed API are installed uninstall before installing

Note: The installer has a limited GUI which does not confirm that the software was installed

Note: The installer has a limited GUI which does not confirm that the software was installed

2. Check (and note) Exchange Certificate Thummbprint

On Exchange 2010 CAS

  • Run the following command in the Exchange Management Shell and note the thumbprint and subject on the certificate you are using

# get-ExchangeCertificate | fl

3. Set Lync server used by Exchange for IM

On Exchange 2010 CAS

  • Run the following command in the Exchange Management Shell

# Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -InstantMessagingServerName <Lync server (or pool) FQDN> -InstantMessagingCertificateThumbprint <thumbprint from previous step> -InstantMessagingEnabled $true -InstantMessagingType 1

  • Open an eleveated command prompt and run “iisreset /noforce” to apply the changes to OWA

4. Finally tell Lync about OWA

On Lync 2010 Server

  • Run the following command in Lync Server Management Shell:

# Get-CsSite (make a note of the siteID)

# New-CsTrustedApplicationPool -Identity <SN of Exchange certificate from step 2> -Registrar <Lync server (or pool) FQDN> -Site <siteId from previous step> -RequiresReplication $false

# New-CsTrustedApplication -ApplicationId OutlookWebApp -TrustedApplicationPoolFqdn <SN of Exchange certificate from step 2>  -Port 9999

# Enable-CsTopology

Lync Mobile Notifications

Just a quick post this time on Lync Mobile client notifications.

Lync mobile app notifications on iOS and Windows Phone 7 devices will only work if you have dynamic federation.

The reason for this is because the app needs to be running to be able to receive notification and iOS and Win Phone 7 do not allow the app to run in the background to receive notifications. For other devices it just works.

Here’s what synamic federation is as explained by Lync Guy (@ http://ocsguy.com/2011/04/20/a-few-words-on-federation/)

Dynamic federation is a method where a partner company’s edge server is discovered by looking up an SRV record (_sipfederationtls._tcp.domain.com).  Dynamic federation is perfect for an environment where users may need to add contacts from other companies quickly and without administrative intervention.  The firewall will have to allow inbound connections to the access edge server on port 5061 from any potential partners, but for most companies who use open federation, they allow traffic from everywhere on this port to prevent needing administrative assistance.

So with the above in mind, if the company who hosts your external DNS does not support SRV records then you will not have dynamic federation or notification on your mobile clients who run iOS or Windows Phone 7.

Lync Mobile App Downloads link (probably easier to just go to your respective app store on your device)


Microsoft Lync Response Group UK Holiday Set

I’ve recently migrated our existing Microsoft Office Communication Server (OCS) 2007 R2 to Microsoft Lync Server 2010. I used to like OCS a lot and my first impressions of Lync are, well I love it!

I’ve set up enterprise voice on Lync and have configured it to route calls through a Trixbox (Asterisk-based software PBX) virtual machine.

Speaking of virtual machines, the Lync (standard edition) front end server and the Lync edge server are Hyper-V virtual machines.

I’ll move onto the purpose of this post now…

Whilst setting up the Lync Response Groups I noticed that the standard holiday lists are empty by default and must be entered via the Lync Server Management Shell (powershell).

You’ll need to use New-CsRgsHoliday command to create the holidays then add them to a “Holiday Set” using the New-CsRgsHolidaySet command. Here’s the TechNet page details this.

To save you some time here are the commands to create all the UK public holidays for 2011 and input them into a holiday set called “2011 Holidays”. (updated due to John’s comment below)

$a = New-CsRgsHoliday -Name "New Year's Day" -StartDate "1/1/2011" -EndDate "1/3/2011" $b = New-CsRgsHoliday -Name "Good Friday" -StartDate "22/4/2011" -EndDate "23/4/2011" $c = New-CsRgsHoliday -Name "Easter Monday" -StartDate "25/4/2011" -EndDate "26/4/2011" $d = New-CsRgsHoliday -Name "Royal Wedding Bank Holiday" -StartDate "29/4/2011" -EndDate "30/4/2011" $e = New-CsRgsHoliday -Name "Early May Bank Holiday" -StartDate "2/5/2011" -EndDate "3/5/2011" $f = New-CsRgsHoliday -Name "Spring Bank Holiday" -StartDate "30/5/2011" -EndDate "31/5/2011" $g = New-CsRgsHoliday -Name "Summer Bank Holiday" -StartDate "29/8/2011" -EndDate "30/8/2011" $h = New-CsRgsHoliday -Name "Boxing Day" -StartDate "26/12/2011" -EndDate "27/12/2011" $i = New-CsRgsHoliday -Name "Christmas Day Holiday" -StartDate "27/12/2011" -EndDate "28/12/2011" New-CsRgsHolidaySet -Parent "applicationserver:<your lync mediation server name>" -name "2011 Holidays" -holidaylist ($a, $b, $c, $d, $e, $f, $g, $h, $i)

Just modify the last line and replace <your lync mediation server name> with the FQDN of your Lync server.

Here’s the same for 2012:

$a = New-CsRgsHoliday -Name "New Year's Day 2012" -StartDate "2/1/2012" -EndDate "3/2/2012"
$b = New-CsRgsHoliday -Name "Good Friday 2012" -StartDate "6/4/2012" -EndDate "7/4/2012"
$c = New-CsRgsHoliday -Name "Easter Monday 2012" -StartDate "9/4/2012" -EndDate "10/4/2012"
$d = New-CsRgsHoliday -Name "Early May Bank Holiday 2012" -StartDate "7/5/2012" -EndDate "8/5/2012"
$e = New-CsRgsHoliday -Name "Spring Bank Holiday 2012" -StartDate "4/6/2012" -EndDate "5/6/2012"
$f = New-CsRgsHoliday -Name "Diamond Jubilee Holiday 2012" -StartDate "5/6/2012" -EndDate "6/6/2012"
$g = New-CsRgsHoliday -Name "Summer Bank Holiday 2012" -StartDate "27/8/2012" -EndDate "28/8/2012"
$h = New-CsRgsHoliday -Name "Christmas Day 2012" -StartDate "25/12/2012" -EndDate "26/12/2012"
$i = New-CsRgsHoliday -Name "Boxing Day 2012" -StartDate "26/12/2012" -EndDate "27/12/2012"
New-CsRgsHolidaySet -Parent "applicationserver:<your lync server name>" -name "2012 Holidays" -holidaylist ($a, $b, $c, $d, $e, $f, $g, $h, $i)

Just copy the whole lot into the Lync Server Management Shell and Bob’s your uncle. Now when you create a hunt or interactive response group you can choose the enable 2011 and 2012 Holidays.