Select Page

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 :



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.



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.


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:




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.


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!


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


Here is the script :