Month: September 2012

Auto answering incoming calls in Lync only from a specific contact using PowerShell

In my last post, I showed how to auto answer incoming Lync calls in PowerShell. I also mentioned that the code provided there does not really care about who is calling you. It simply auto answers calls from anyone. This may not be a desired thing in real-life. If you don’t have Lync SDK installed (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. As I’d mentioned in the post, the Lync Conversation namespace provides the necessary properties to detect who is calling us. We can use the Participants property of this namespace to enumerate the contact information for an incoming conversation. Before we dive deep into the details here, let us see a technique to easily walk-through the Conversation namespace when we receive a ConversationAdded event. The idea is simple. Whenever this event gets triggered, we assign the event details to a global variable that we …

Auto answering incoming calls in Lync using PowerShell

In the last post, I gave a brief introduction to Lync 2010 SDK for client side automation. And, then I showed an example of quickly accessing Lync client objects for setting status text and availability. In today’s post, let us look at a simple script that combines PowerShell eventing and Lync conversation events to auto-answer an incoming Lync call. If you don’t have Lync SDK installed (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. Without further delay, here is the code to achieve what I just said:

This is it. After you run this code snippet (don’t forget the event subscriptions using Register-ObjectEvent cmdlet are only available in the current PS session), all your Lync calls get auto-answered. Now, why would anyone on earth do that? Well, that is a great question. There is no need in fact. This is just a pre-cursor …

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: http://www.microsoft.com/en-us/download/details.aspx?id=18898 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 …