Lync 2013 – Oauth On-Premises (Lync Server 2013 and Exchange 2013)

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

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)

Lync – Get-MCsPool

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 :

Get-MCsPool

 

Communication Server versions tested
Office Communication Server 2007
Microsoft Lync Server 2010 OK
Microsoft Lync Server 2013 OK

 

Lync 2013 – Activate Unified Contact Store

 

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 :

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:

 


 

Check

On outlook 2013, got to Contacts and verify you have the Lync Contacts folder as in the picture :

 

UCS Outlook

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.

 

UCS Lync Configuration Info

Change Voice Policy of Lync 2013 Response Group Workflow, Dialin, or any other service

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…) :

So if you want to change the voice Policy of a Workflow with powershell, here is the cmdlet :

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 :

This is working for all the policies.

Karl

Disable Close button in Powershell Window

I did some powershell scripting these days.

Disabled Window running script

Disabled Window running script

Someone asked me if it would be possible to avoid the user to close the powershell window while a script is running (logon or any other). After a few searches in the MSDN world, I was able to handle the window and send some parameters to it.

For this, I ask the user32.dll Library to disable the powershell window and to disable the button (close menu). To remove any undesired button, I set the Windows style to Toolbox.

I know the fact of disabling window will avoid any user input and click on any button, but as they asked me to disable the button, I dit it this way. So use the rest as know-how… 🙂

Knowing what I need to code, I will use some user32.dll methods :

  • GetSytemMenu
  • EnableMenuItem
  • SetWindowLongPtr
  • EnableWindow

Hope that this script can be useful to some admins!

Karl

Windows versions tested
Windows 2000
Windows XP
Windows 7 OK
Windows 8
Windows 8.1 Standard OK (Disabled window only)

 

Here is the script :