by Karl Bustamante | Nov 4, 2014 | Lync 2013, Microsoft, Powershell, Windows Server 2012
What is this?
Since Lync Server 2013, there is a new prerequisite on the Lync Servers for Exchange 2013 interconnection: This will allow you to use :
- Unified Contact Store (UCS)
- Exchange OWA IM and presence Integration
Windows Identity Foundation
“It’s a new extension to the Microsoft .NET Framework that makes it easy for developers to enable advanced identity capabilities in the .NET Framework applications.” This feature has been created to support server to server authentication. It is used by asp.net and Windows Communication Foundation applications. (In our situation, by Lync server 2013 and Exchange Server 2013) In order to configure Oauth, you must do two things:
- Assign a certificate to Lync Server’s
- Set Exchange as a partner application.
Please note : “It should also be pointed out that you do not need to use server-to-server authentication: server-to-server authentication is not required in order to deploy Lync Server 2013. If Lync Server 2013 does not need to communicate with other servers (such as Exchange 2013) then server-to-server authentication is not needed.” Source Also note that “your Lync Server 2013 default certificate can also be used as the OAuthTokenIssuer certificate” Source
Installation
There is two ways to install the WIF : Windows Server 2008 R2 Install with the Windows Identity Foundation (KB974405) installer. Windows Server 2012 Server Manager Go to Add Roles and Features Wizard, select Features. Select Windows Identity Foundation 3.5 from the list. Click Next, then click Install. Powershell
Add-WindowsFeature Windows-Identity-Foundation
Once WIF has been installed you can run Deployment Wizard and Assign the Lync default certificate to Oauth certificate.
Sources
Description of Windows Identity Foundation (http://support.microsoft.com/kb/974405/en-us) Microsoft TechNet – Lync Server 2013 (http://technet.microsoft.com/en-us/library/gg398616.aspx)
by Karl Bustamante | Oct 28, 2014 | Lync 2013, Microsoft
I needed a precise list of what is on Lync Updates so I managed to insert every useful data in one table.
As well, I give you a simple script which allows you to get the CU version on the Lync Server actually deployed.
Do not forget the Install-CsDatabase cmdlet if you install the Cumulative Update from October.
Security Update5.0.8308.927September 20153080353Update for Web Components Server
Cumulative Update |
Lync Server Version |
Date Released |
Associated KB |
Updates |
Server to Apply |
CU 1 |
5.0.8308.291 |
February 2013 |
2781547 |
Address Book Web Query service
ABS databases
location policy |
CU 2 |
5.0.8308.420 |
July 2013 |
2819565 |
Update for Persistent Chat server
Update for Conferencing server
Update for Unified Communications Managed API 3.0 Workflow APIs |
CU 3 |
5.0.8308.556 |
October 2013 |
2881684 |
Update for Mediation server
Update for Conferencing Announcement
Update for Call Park Service |
CU 4 |
5.0.8308.577 |
January 2014 |
2910244 |
Update for Backup Service
Update for Central Management Server |
CU 5 |
5.0.8308.738 |
August 2014 |
2937310 |
Update for Windows Fabric
Update for Web Conferencing server
Update for Administrative Tools |
CU 6 |
5.0.8308.815 |
September 2014 |
2987510 |
Update for Conferencing Attendant
Update for Core Components
Update for Web Components server
Update for Unified Communications Managed API 4.0, Core Runtime 64-bit
Update for Standard or Enterprise Edition server (Front End Servers and Edge Servers) |
CU 7 |
5.0.8308.831 |
October 2014 |
3001616 |
Update for IM |
CU 8 |
5.0.8308.834 |
November 2014 |
3010032 |
Update for |
CU 9 |
5.0.8308.857 |
December 2014 |
3018158 |
Update for |
CU 10 |
5.0.8308.871 |
February 2015 |
3031061 |
Update for Conference Service
Update for Conference Service |
CU 11 |
5.0.8308.887 |
May 2015 |
3051949 |
Update for URL filter policy (“http://” not filtered) |
CU 12 |
5.0.8308.920 |
July 2015 |
3066655 |
Update for XMPP Gateway
Update for XMPP Proxy
Update for Application Host
Update for Audio Test service
Update for Core Management Server
Update for Backup Service
Update for Unified Communications Managed API 4.0 Runtime
Update for web components server
Update for core components
Update for Call Park service
Update for Conferencing Announcement
Update for Conferencing Attendant
Update for Mediation Server
Update for Administrative Tools
Update for Web Conferencing server
Update for UCMA 3.0 Workflow APIs
Update for Conferencing Server
Update for Persistent Chat
Update for Bandwidth Policy service
Update for Reponse Group Service |
Standard Edition server
Enterprise Edition – front-end server and back-end server
Edge server
stand-alone Mediation server
Director server
Persistent Chat front-end server
Administration Tools |
Security Update |
5.0.8308.927 |
September 2015 |
3080353 – MS15-104 |
Update for Web Components Server |
## This script will be updated soon
function Get-CsCUVersion{
[String]$Servers=$env:COMPUTERNAME+"."+$env:USERDNSDOMAIN
$version=(Get-CsManagementStoreReplicationStatus -ReplicaFqdn $Servers).productversion
#Lync server 2010 CU List
if ($version -like "4.0.7577.108"){return $version="Lync 2010 CU1 January 2011 - $($version)"}
if ($version -like "4.0.7577.137"){return $version="Lync 2010 CU2 April 2011 - $($version)"}
if ($version -like "4.0.7577.166"){return $version="Lync 2010 CU3 July 2011 - $($version)"}
if ($version -like "4.0.7577.183"){return $version="Lync 2010 CU4 November 2011 - $($version)"}
if ($version -like "4.0.7577.190"){return $version="Lync 2010 CU5 February 2011 - $($version)"}
if ($version -like "4.0.7577.199"){return $version="Lync 2010 CU6 June 2012 - $($version)"}
if ($version -like "4.0.7577.203"){return $version="Lync 2010 CU7 October 2012 - $($version)"}
if ($version -like "4.0.7577.216"){return $version="Lync 2010 CU8 March 2013 - $($version)"}
if ($version -like "4.0.7577.217"){return $version="Lync 2010 CU9 July 2013 - $($version)"}
if ($version -like "4.0.7577.223"){return $version="Lync 2010 CU10 October 2013 - $($version)"}
if ($version -like "4.0.7577.225"){return $version="Lync 2010 CU11 January 2014 - $($version)"}
if ($version -like "4.0.7577.230"){return $version="Lync 2010 CU12 April 2014 - $($version)"}
if ($version -like "4.0*"){return $version="Lync 2010 - $($version)"}
#Lync server 2013 CU List
if ($version -like "5.0.8308.291"){return $version="Lync 2013 CU1 February 2013 - $($version)"}
if ($version -like "5.0.8308.420"){return $version="Lync 2013 CU2 July 2013 - $($version)"}
if ($version -like "5.0.8308.556"){return $version="Lync 2013 CU3 October 2013 - $($version)"}
if ($version -like "5.0.8308.577"){return $version="Lync 2013 CU4 January 2014 - $($version)"}
if ($version -like "5.0.8308.738"){return $version="Lync 2013 CU5 August 2014 - $($version)"}
if ($version -like "5.0.8308.815"){return $version="Lync 2013 CU6 September 2014 - $($version)"}
if ($version -like "5.0*"){return $version="Lync 2013 - $($version)"}
}
by Karl Bustamante | Jul 8, 2014 | Lync 2010, Lync 2013, Microsoft, Powershell
When you look for a simple way to get all Lync Server topology, you probably will do a Get-CsPool command. But here, you don’t see the sites and the output is not coming in a easily readable way.
The script below will let you Show all information at once.
Get-MCsPool will show you your infrastructure in an easy way :

Communication Server versions tested |
Office Communication Server 2007 |
– |
Microsoft Lync Server 2010 |
OK |
Microsoft Lync Server 2013 |
OK |
function Get-MCsPool{
foreach ($site in Get-Cssite){
Write-Host "Site : " $site.Displayname "( " -NoNewline -ForegroundColor Green
if ($site.Description -notlike ""){
Write-Host $site.Description")" -foregroundcolor Green
}else{
Write-Host "No description" -foregroundcolor DarkRed -NoNewline
Write-Host " )" -foregroundcolor Green
}
$pools = $site | select -ExpandProperty pools
foreach ($pool in $pools){
$boolDiscovered = $false
[array]$ServerType = ""
Write-Host "Pool : " $pool -ForegroundColor Cyan -NoNewline
$services = Get-CsPool $pool | select -ExpandProperty services #Get all services from the current pool
If ($Site.ParentSite -ne $Null){ #SBA
if ($services.count -ge 2){
$ServerType += "Survivable Branch Appliance"
$boolDiscovered = $true
}else{
$ServerType += " PSTN Gateway "
$boolDiscovered = $true
}
}else{ #NO SBA
$PoolComputersCount = (get-cspool $pool | select -ExpandProperty computers ).count #Get the computer numbers in a pool
if ($PoolComputersCount -ge 2){ #POOL SERVERS (If there is 2 or more computers
$findOut = $services -match '.*Registrar:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Enterprise Edition Pool"
$boolDiscovered = $true
}
$findOut = $services -match '.*PersistentChatService:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Persistent Chat Pool"
$boolDiscovered = $true
}
$findOut = $services -match '.*TrustedApplicationPool:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Trusted Application Pool"
$boolDiscovered = $true
}
$findOut = $services -match '.*EdgeServer:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "EDGE Pool"
$boolDiscovered = $true
}
}else{ #STANDALONE SERVERS (Only one computer)
$findOut = $services -match '.*Registrar:([a-zA-Z]).*'
if ($findOut) {
$Registrar = $findOut -replace "Registrar:",""
$ServerType += "Standard Edition Pool"
$boolDiscovered = $true
}
$findOut = $services -match '.*PstnGateway:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "PSTN Gateway"
$boolDiscovered = $true
}
$findOut = $services -match '.*EdgeServer:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "EDGE Server"
$boolDiscovered = $true
}
$findOut = $services -match '.*MonitoringServer:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Monitoring Server"
$boolDiscovered = $true
}
$findOut = $services -match '.*ArchivingServer:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Archiving Server"
$boolDiscovered = $true
}
$findOut = $services -match '.*WacServer:([a-zA-Z]).*' #Lync 2013
if ($findOut) {
$ServerType += "Office Web Apps Server"
$boolDiscovered = $true
}else{
$findOut = $services -match '.*WacService:([a-zA-Z]).*' #Lync 2010
if ($findOut) {
$ServerType += "Office Web Apps Server"
$boolDiscovered = $true
}
}
$findOut = $services -match '.*TrustedApplicationPool:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Trusted Application Server"
$boolDiscovered = $true
}
$findOut = $services -match '.*FileStore:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "File Server"
$boolDiscovered = $true
}
$findOut = $services -match '.*ApplicationDatabase:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "SQL Server"
$boolDiscovered = $true
}
$findOut = $services -match '.*PersistentChatServer:([a-zA-Z]).*'
if ($findOut) {
$ServerType += "Persistent Chat Server"
$boolDiscovered = $true
}
}#End pool or no pool
}#end sba or no sba
if (!$boolDiscovered){ #If the variable is false, it means the service is unknown
Write-Host " (N/A)" -ForegroundColor Gray -NoNewline
}else{#If the variable is true, it means the service was discovered
foreach ($type in $ServerType){
if ($type -notlike ""){
if (($type -like "*Edition*") -or ($type -like "Survivable*")){ #For the main pools, Write in Yellow
Write-Host " ["$type" ]" -ForegroundColor Yellow -NoNewline
}else{
Write-Host " ["$type" ]" -ForegroundColor DarkCyan -NoNewline #For the normal service types, write in darkcyan
}
}
}
}
Write-Host "" #Add a return after each line
}#Close Pools foreach
}#Close Site foreach
}#Close Get-MCsPool function
by Karl Bustamante | Apr 10, 2014 | Lync 2013, Microsoft, Powershell
This post will explain the Unified Contact Store on Microsoft Lync 2013 and Exchange 2013 deployments.
What is this?
This is a feature who will share the contacts between all the Microsoft Office products. In fact, it will store all contact information in Exchange 2013 and make it available for :
- Lync Client 2013
- Exchange 2013
- Outlook 2013
- Outlook Web Access 2013
This makes the contacts available globally in the organization.
Prerequisites
You must be running Microsoft Lync Server 2013 and Exchange 2013.
- Users must use Lync 2013 to initiate the migration of contacts from Lync Server 2013 to Exchange 2013.
- User mailboxes must be migrated to Exchange 2013.
- You must have server-to-server authentication (Oauth) configured between Lync Server 2013 and Exchange 2013.
- Lync 2010 Client and older versions will not be able to work with UCS (they can only read contacts).
I will explain the process of creating an Oauth partnership with Exchange 2013 in my next post.
Activation
Ensure you get all the prerequisites before activating.
In order to test it, create a User Policy that you will assign to you before enabling everyone :
New-CsUserServicesPolicy -Identity "UserSvcPolicy-UCSEnabled" -UcsAllowed $True
Grant-CsUserServicesPolicy -Identity "JohnDoeAdmin" -PolicyName "UserSvcPolicy-UCSEnabled"
After you see everything is working fine, you can activate UCS for all users, you only need to change the Global User Service Policy using PowerShell:
Set-CsUserServicesPolicy -Identity global -UcsAllowed $True
Check
On outlook 2013, got to Contacts and verify you have the Lync Contacts folder as in the picture :

On Lync Client, check the Lync Configuration Information page (Pres Ctrl and right click the Lync icon, then go to Configuration Information).
It may be an entry named Contact List Provider. It may have changed to UCS instead of Lync Server.

by Karl Bustamante | Mar 27, 2014 | Lync 2010, Lync 2013, Powershell
There is two ways to change the Voice Policy with Lync 2013.
- CmdLets
- Active Directory (advanced)
First of all, we will se how to get the Voice Policy from an Application Endpoint (Workflow, Dialin etc…) :
Get-CsApplicationEndpoint -Identity "*WorkflowName*" | Select VoicePolicy
Get-CsApplicationEndpoint -Identity "*WorkflowName*" | FL *
So if you want to change the voice Policy of a Workflow with powershell, here is the cmdlet :
Get-CsApplicationEndpoint -Identity "*WorkflowName*" | GrantCsVoicePolicy -PolicyName "VPolicy-US-International"
Now we are going to be more “serious” by going to make changes in the Active Directory for the workflow itself.
First, depending on your environment, the RTC services folder can be found in different paths:
- [Configuration]/Services/RTC Services/Application Contacts
- [Domain Naming Context]/Services/Microsoft/RTC Services/Application Contacts
Once you’re in the path, search for the Active Directory Contact object that is your workflow, and modifies the attribute of msRTCSIP-UserPolicies.
It may have some entries like “0=123,1=6,7=2,…”
The “7=” is the voice Policy pointer. So to assign the correct voice Policy number to the Contact, Show the anchors of the voice policies in powershell and add it to the contact.
Powershell Voice Policy Anchor :
Get-CsVoicePolicy | select Anchor
This is working for all the policies.
Karl
by Karl Bustamante | Jan 7, 2014 | Lync 2010, Lync 2013

Hi,
This is a simple script you can use to see which server has active calls (mediation).
This uses the Get-CsWindowsService cmdlet to get the RTCMEDSRV values. This can be useful if you need to restart a server.
If you need only one server, you can also use this command :
Get-CsWindowsService -Name RTCMEDSRV | select activitylevel
To launch the function, just write the function name followed by the computername :
Get-CsActiveCalls computer01,computer02,computer03,computer04
This will show you the active calls like in the picture.
A few modifications : powershell seems to keep all values from before, so we just clear the values after showing the object with Clear-Item.
Communication Server versions tested |
Office Communication Server 2007 |
– |
Microsoft Lync Server 2010 |
OK |
Microsoft Lync Server 2013 |
OK |
Here is the script :
function Get-CsActiveCalls {
param (
[parameter(Mandatory=$false)][array]$Computer = $env:computername
)
$BeforeErrorActionPreference=$ErrorActionPreference
$BeforeProgressPreference = $ProgressPreference
$ErrorActionPreference="SilentlyContinue"
$ProgressPreference = "SilentlyContinue"
cls
$DateTimeDone = (Get-Date).tostring()
Write-Host "Calls state on " -NoNewline
Write-Host $DateTimeDone -ForegroundColor Green
foreach ($PC in $Computer) {
$x = Get-CsWindowsService -Name RTCMEDSRV -ComputerName $PC | select -expandproperty activitylevel
$obj = New-Object PSObject
$obj | Add-Member NoteProperty "Computer" $PC #.ToString()
$findOut = $x -match '.*Current Outbound Calls=(\d+),.*'
if ($findOut) {
$outbound = $matches[1]
$obj | Add-Member NoteProperty "Outbound Calls" $outbound #.ToString()
}
$findIn = $x -match '.*Current Inbound Calls=(\d+),.*'
if ($findIn) {
$inbound = $matches[1]
$obj | Add-Member NoteProperty "Inbound Calls" $inbound #.ToString()
}
$obj
}
Clear-Item $matches
Clear-Item $obj
Clear-Item $x
Write-Host "Press any key to continue ..." -ForegroundColor yellow
$KeyDown = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
$ErrorActionPreference=$BeforeErrorActionPreference
$ProgressPreference=$BeforeProgressPreference
}
Get-CsActiveCalls computer01,computer02,computer03,computer04