Year: 2012

PowerShell 3.0 Workflows @ PowerShell Bangalore User Group meeting

I had a great time presenting the Windows PowerShell 3.0 Workflows topic at the @PSBug meet yesterday! This was a level 100 session on introducing PowerShell Workflows and gave me an insight into what exactly the beginners are looking for. Thanks to the participants for making it interactive. Here is the deck I used for the session! This is an abstracted version and may not give you a complete overview by itself. But, you can use this as a good starting point. PowerShell 3.0 workflows from Ravikanth Chaganti  

PowerShell Bangalore User Group meet December 15th, 2012 – PowerShell 3.0 Workflows

Bangalore IT Pro (BITPro) and PowerShell Bangalore User Group (PSBUG) are conducting a combined user group meet event (in-person) on December 15th, 2012.We start the event with an ITPro session on Windows Server 2012 Features overview. Kailash Chander – lead engineer at Dell in the Windows Server OS Engineering team – will given a Server 2012 features overview and deep dive into a couple of features. I will be talking about Windows PowerShell 3.0 Workflows at this event. Here is a detailed agenda and registration link: Event registration for Bangalore PowerShell & ITPro UG Meet – December 15th powered by Eventbrite This is an in-person only event. I will try and record the session for later availability.

PoshUtils: Get all mirrored SQL databases using PowerShell and SMO

I have been validating different aspects of SQL mirroring and in the process I wanted a quick and automated way to handle database mirroring functions. This includes listing all mirrored databases, failing over databases manually to a mirrored instance, etc. So, in the process, I created several small functions in PowerShell to achieve what I wanted. I will share these functions as a series of posts and eventually, will release a PoshUtils module. So, in today’s post, let us see how we can retrieve a list of all SQL databases that are mirrored. This function can work with both default and named instances. Also, this assumes that you are using Windows authentication. Let us see the function:

When you run the Get-MirroredDatabase function, it returns a list of all databases that are mirrored and all properties of each database. You can filter the output by selecting the properties you want.

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 …