Haiku #60

The blank sheet beckons

But no words come. Hmm, maybe

ClientPinInfo?

It's obviously Friday, because for the past 10 minutes or so the author of today's haiku has just been sitting at his desk, half-staring at a computer screen that doesn't actually include a haiku. It's been a long week.

Note. Is it possible that he's suffering from writer's block? Probably not. As poet William Stafford once said, "There's no such thing as writer's block for writers whose standards are low enough." And could your standards get any lower than writing a daily haiku about Lync Server PowerShell?

But long week or not, duty calls, and when duty calls the author of today's haiku usually tries to find someone else to answer the call. And what happens if he can't find someone else to answer the call? Then he talks about the Get-CsClientPinInfo cmdlet.

Which is just exactly what Fyodor Dostoyevsky used to do when he had nothing to write about.

Get-CsClientPinInfo is one of our favorite cmdlets, if for no other reason than the name pretty much tells you exactly what the cmdlet is used for: it gets back information about client PINs. What, you ask, are client PINs? Well, as you no doubt know, one cool feature of Microsoft Lync Server 2010 is dial-in conferencing, which enables users to connect to the system or to join the audio portion of a conference by using a telephone. And that doesn't mean you need some fancy VoIP telephone or something; any old telephone, even a cell phone, will work just fine.

Note. One possible exception would be this cool, refurbished phone (dating back to the early 1900s) that the author of today's haiku got for Christmas a few years ago. That phone has no dial; the only way to make a call with it is to pick up the receiver and talk to the operator. And seeing as how the phone company no longer uses operators, that means he can't ever make a call with that phone.

Which, in his mind anyway, makes that a pretty darn good phone.

When you connect to Lync Server or join a conference, you're typically required to enter a user name and password. However, that can be a problem if your phone doesn't have an alphanumeric keypad. (Try entering Ken Myer using only numbers, no letters. It's hard to do!) Because of that, Lync Server 2010 lets you dial in and log on using a numeric-only PIN (personal identification number); when prompted, users can log on to the system or join a conference by entering the PIN instead of a user name and password.

And yes, that is pretty sweet, isn't it?

At any rate, as an administrator you can use the Set-CsClientPin cmdlet to assign PINs to your users, or users can assign themselves a PIN by accessing the Dial-in Conferencing Settings and PIN Management page. (From within Microsoft Lync, select Dial-in Conferencing Settings from the Tools menu.) And then you can use the Get-CsClientPinInfo cmdlet to retrieve information about the users and their PIN settings.

What kind of information? Well, to begin with, we should note that one thing you can't do is retrieve a user's PIN number. Suppose Ken Myer forgets his PIN. You can't look that information up for him; all you can do is use Set-CsClientPin to assign him a new PIN number.

Instead, Get-CsClientPinInfo returns information like this (assuming you just ran the command Get-CsClientPinInfo –Identity "Ken Myer" ):

Identity : sip:kenmyer@litwareinc.com

IsPinSet : True

IsLockedOut : False

LastPinChangeTime : 3/4/2011 8:49:00 AM

PinExpirationTime : 6/12/2011 8:49:00 AM

Is this useful information? You bet it is. The IsPinSet property tells you whether or not a user even has a PIN. Would you like to see information about all your users who don't have a PIN? Then just run this command:

Get-CsUser | Get-CsClientPinInfo | Where-Object {$_.IsPinSet –eq $False}

Ah, good question: why didn't we use a command like this:

Get-CsClientPinInfo | Where-Object {$_.IsPinSet –eq $False}

Well, to be honest, the main reason we didn't use a command like that is because it won't work. You can call many Lync Server PowerShell Get-Cs*cmdlets without specifying an Identity, and the cmdlet will return information about all the whatevers you just asked for. For example, call Get-CsUser without specifying an Identity and you'll get back information about all your Lync-enabled users:

Get-CsUser

For some reason, though, that's not the case with Get-CsClientPinInfo. Try running this command:

Get-CsClientPinInfo

Are you going to get back PIN information for all your users? No. Instead, the cmdlet is going to prompt you to enter an Identity:

Get-CsClientPinInfo

Cmdlet Get-CsClientPinInfo at command pipeline position 1

Supply values for the following parameters:

Identity:

Because of that, we have to use Get-CsUser to first retrieve all our user accounts, and then pipe that information to Get-CsClientPinInfo. Get-CsClientPinInfo can then use the pipelined data to retrieve PIN information for each of those users.

It's an extra step, but it works.

Now, where we were? Oh yes, the IsLockedOut property. The IsLockedOut property tells you if a PIN has been locked, either because a user exceeded the maximum number of failed logon attempts (that is, they tried to log on, and kept entering the wrong PIN) or because you locked them out using the Lock-CsClientPin cmdlet. Either way, you can retrieve a list of users with locked PINs by running this command:

Get-CsUser | Get-CsClientPinInfo | Where-Object {$_.IsPinLocked –eq $True}

Note. You know, this is kind of fun, isn't it? You can see why Fyodor Dostoyevsky got such a kick out of the Get-CsClientPinInfo cmdlet.

And then there's PinExpirationTime, which lets you know when a user's PIN is going to expire. Need a list of users whose PINs will expire before April 1, 2011? No problem:

Get-CsUser | Get-CsClientPinInfo | Where-Object {$_.PinExpirationTime –lt "4/1/2011" –and $_.PinExpirationTime –ne $Null}

So why did we tack on this second clause:

$_.PinExpirationTime –ne $Null

That simply prevents us from getting back information about people who have PINs that don't expire (that is, their PinExpirationTime property is null). In fact, if we'd rather have a list of people who have non-expiring PINs, well, that's no problem, either:

Get-CsUser | Get-CsClientPinInfo | Where-Object {$_.PinExpirationTime –eq $Null}

Note. How do you ensure that people have PINs that do expire? You need to use New-CsPinPolicy or Set-CsPinPolicy and assign values to the PINHistoryCount and PINLifetime properties.

Or at least that's what Fyodor Dostoyevsky told us.

That should do it for today, and for this week. And don't worry; we won't have any problem with writer's block next week, not after we stumbled upon this suggestion from comedian Steve Martin:

Go to an already published novel and find a sentence that you absolutely adore. Copy it down in your manuscript. Usually, that sentence will lead you to another sentence, and pretty soon your own ideas will start to flow. If they don't, copy down the next sentence in the novel. You can safely use up to three sentences of someone else's work -- unless you're friends, then two. The odds of being found out are very slim, and even if you are there's usually no jail time.

We have a feeling that, from now, these haikus are going to be much easier to write.