Lync Client, PowerShell, Scripting
comments 5

Scripting Lync 2010 Client in PowerShell

Off late, I have been working on the Lync 2010 client SDK to understand how I can automate some tasks such as updating my Lync status or auto-answer Lync calls or IM conversations when I am away from my computer or in a meeting, etc. This is just the beginning of the list. There are several other tasks I have automated and I will eventually post here.

Here is the link to download Lync 2010 SDK:

Also, make a note of the requirements to install Lync SDK:

    • Visual Studio 2008 SP1 or Visual Studio 2010 RTM for Microsoft Windows Forms or WPF development.
    • Visual Studio 2010 RTM for Silverlight development.
    • Microsoft .NET Framework 3.5 or later service pack.
    • Microsoft Silverlight 4.0 runtime, installed with Lync 2010.
    • Microsoft Silverlight 4 Tools for Visual Studio 2010.
If you don’t want to install Lync 2010 SDK (it comes with a lot of unnecessary baggage), you can just copy the model DLL at “C:\Program Files (x86)\Microsoft Lync\SDK\Assemblies\Desktop\Microsoft.Lync.Model.Dll” from a machine that has Lync SDK installed. This should be sufficient for the task outlined in this post.

For now, I will start with a basic overview of the Lync scripting model and then show a simple example of changing the Lync client status using PowerShell.

There are two Lync development models as described in Lync 2010 SDK documentation:

  • Lync 2010 Controls provides features such as search, presence, instant messaging (IM) calls, and voice calls, which can be integrated into custom applications.
  • Lync 2010 API provides the programming interfaces to develop Lync 2010 applications.

In the context of this post and all other future posts in this topic, I shall talk only about the Lync 2010 API and not the controls.

In the context of Lync 2010 API, there are two development scenarios:

  • Lync 2010 Model API can be used to replicate Microsoft Lync 2010 features in an application while suppressing the Lync 2010 user interface.
  • Lync 2010 Extensibility API can be extend an existing application by integrating a new Microsoft Lync 2010 conversation window in the application.

In the Lync 2010 model API — in UI suppression mode — several Lync 2010 features are not available. This is where the extensiblity API can be used effectively.

So, that is a 30000 ft. overview of Lync 2010 SDK. Let us see example on using Lync 2010 API to change the status of the Lync 2010 client.

The above example is self-explanatory. The first step loads the model API and the subsequent steps load the client object and perform status updates. Stay tuned for more.

Filed under: Lync Client, PowerShell, Scripting


Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.