Saturday, October 05, 2013

Lync 2013 PowerShell Module–An Overview

In an earlier article, I wrote about the new Lync 2013 Test Drive. This is a set of 7 Virtual Machines that implement Lync for you to play with. These VMs enable you to test out and work with Lync Server 23013. SharePoint is also included in the Test Drive – although that’s probably a subject for a separate blog post or posts.

So what’s the first thing to look at? Well, for me, as a PowerShell guy – the first thing is obviously the Lync module. You can get the Lync Module either by using the Lync Console shortcuts provided when you install Lync. Alternatively, you can use it directly from a PowerShell console running on any system that has the Lync tools loaded.

You import this module by using the Import-Module cmdlet. With PowerShell V3, you do not really need to import the module explicitly, as by using any cmdlet, you get the module auto-loaded for you. And of course, you can turn this auto-load feature off should wish to. The Test Drive VMs all utilise PowerShell V3.

When I load the Lync module, the first thing I do is to look at how many cmdlets are contained in the Module. That was easy, although I was very surprised at the result:

image

As you can see by following the red arrow – there are 739 cmdlets in the Lync module. Now I’m not sure what YOU think of this, but my immediate reaction is astonishment. That’s a lot of cmdlets to learn. The good news is you can use PowerShell’s discovery features to help.

First, let’s look at the verbs that are used in these cmdlets. I find the verbs give a feeling of what sorts of actions we are expecting the cmdlets to perform. I use a simple one-liner to work out what verbs are used in Lync Cmdlets – which looks like this:

image

As I count it, that makes for 35 verbs, although 12 verbs are used just once, and 5 are just used twice. Interestingly, just over 3/4 of all the cmdlets use Get, Set, New or Remove which isn’t too surprising.

A more interesting bit of output would be the nouns used in the cmdlets. The nouns represent the different types of objects that you are going to manage with a module. While verbs, in cmdlet names, are generic and standardised, it’s the nouns that are task specific.

In the case of Lync, there are a large number of different nouns:

image

TWO HUNDRED EIGHTY FOUR nouns. If your jaw dropped with the number of cmdlets, there are 284 separate objects which are used as the target of one or more Lync Cmdlets. This is also a pretty big job in terms of the documentation – since each of these cmdlets and the objects they interact with need documentation.

So how do you get started?  In some coming blog posts, I’ll be taking a look at the various sub-sets of cmdlets and introduce them to you!

No comments: