All posts tagged: Lync Client

Finding Lync contact capabilities using PowerShell

I wrote my last post on Finding Lync contact availability using PowerShell exactly a month ago! Life has been busy. I had my Masters exams and then lot of backlog at work! Well, I am back and it feels good to be writing again. As a continuation to the Lync series of posts, I will show you how to find the Lync conact capabilities using PowerShell. This is especially important when we want to automatically invoke a voice call or a video chat with a Lync contact. The method for this is very similar to finding the Lync contact availability. 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. For today’s post, we will once again look at the ContactManager class. As usual, let us first get the Lync Model namespace loaded.

Once we have the $client instance, we can use the GetContactByUri method in ContactManager …

Finding Lync contact availability using PowerShell

In the earlier post, we went through the Lync client scripting model to understand how we can auto-answer an incoming call from a specific contact. Now, from today’s post onwards, let us look at how we can initiate a conversation or a call from the local Lync session. 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. Before going there, we need to first look at how we can find whether a Lync contact is online or not. This can be found using the ContactManager class. As usual, let us first get the Lync Model namespace loaded.

Once we have the $client instance, we can use the GetContactByUri method in ContactManager class to create a new contact object. The argument to this method can be an email address or SIP uri or a phone number.

After the above …

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 …