Month: October 2012

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 …