Seems like only yesterday
We had 99.
Hey, everyone, and welcome to the Lync Server PowerShell haiku of the day. (Note that this is the original Lync Server PowerShell haiku of the day, and not one of the many imitation Lync Server PowerShell haiku sites springing up all over the Internet.)
Today is a truly momentous occasion for those of us here at the Lync Server PowerShell blog: today marks the 100th edition of the haiku of the day! At the risk of patting ourselves on the back, we’d like to take a few minutes to read all the congratulatory emails and telegrams that have been pouring in throughout the morning:
OK, that didn’t take quite as long as we thought it would. Of course, the Internet is probably a bit overloaded at the moment. The next time they have a Royal Wedding we’ll ask them to please schedule it for a day when we don’t have a Lync Server PowerShell haiku. The Royal Wedding and the 100th Lync Server PowerShell haiku, all on the same day? That’s just too much excitement for one day.
History buffs out there might be interested to know that the Lync Server PowerShell haiku of the day was originally conceived by the Danish physicist Niels Bohr way back in October of 1913. At the time, Bohr was ridiculed by his fellow scientists, in part because there was no such thing as Windows PowerShell and no such thing as Microsoft Lync Server. Those of us who believed in Bohr and his vision refused to give up, however, and now, 98 years later, we have the fruit of our labors: the 100th edition of the Haiku of the Day!
At any rate, on with the show. For our 100th edition of the haiku of the day we did what we always we do when it comes time to pick a topic: we rolled the dice, and we came up with the Lync PowerShell noun of the day. Ladies and gentlemen: CsPresence!
As it turns out, there’s only one cmdlet that falls into the CsPresence family: Test-CsPresence. That means that today’s article should be an easy one to write up.
The Test-CsPresence cmdlet is designed to do one thing and one thing only: it checks to see if two users can log on to Lync Server and exchange presence information. The cmdlet will try to log the two users on to the system and then see if those users can exchange presence information. If they can, you’ll get back something that looks like this:
TargetFqdn : atl-cs-001.litwareinc.com
Result : Success
Latency : 00:00:00.3227016
And if those two users can’t exchange presence information? Then you’ll get back results like these:
TargetFqdn : atl-cs-001.litwareinc.com
Result : Failure
Latency : 00:00:00
Error : Presence notification is not received within 25 secs.
At that point, you can re-run the test, this time adding the Verbose parameter to ensure that you get a blow-by-blow account of everything the cmdlet tries to do. For example, in our test that failed, the Verbose parameter showed us that both users were able to log on and configure themselves to receive presence information from one another; however, our first user was unable to actually publish his presence information. Why? Well, to be honest, we’re not sure; we didn’t bother to investigate this in full. However, we re-ran the test using a different user and everything worked fine. We then put the original user back in, and encountered the same problem we encountered before. If nothing else, that helps us narrow things down a bit: as near as we can tell, the problem lies not with the system itself but with that one user account.
Ah, good question: how did we run these tests? Well, if you have configured health monitoring configuration settings for a Registrar pool all you need to do is run a command like this one:
Test-CsPresence –TargetFqdn atl-cs-001.litwareinc.com
If you don’t specify any user accounts, Test-CsPresence will automatically use the two health monitoring accounts configured for the pool and run its checks using those accounts.
Alternatively, you can also run this check using any two Lync Server-enabled user accounts; the only catch is that you have to supply the user name and password for each of those accounts. Assuming that you have that information, then commands like these will let you determine whether or not a pair of real, live users can exchange presence information:
$cred1 = Get-Credential “litwareinc\pilar”
$cred2 = Get-Credential “litwareinc\kenmyer”
Test-CsPresence -TargetFqdn atl-cs-001.litwareinc.com -SubscriberSipAddress “sip:email@example.com” -SubscriberCredential $cred1 -PublisherSipAddress “sip:firstname.lastname@example.org” -PublisherCredential $cred2
All in all, a pretty handy little cmdlet to have at your disposal.
Before we go we’d like to acknowledge a few other 100th anniversaries:
· The Southeastern Massachusetts YWCA
· The state of Massachusetts, celebrating the first law to ever make it illegal to sell or possess cannabis without a prescription
· The Evansville Bar Association
· International Women’s Day
· Washington High School in Milwaukee, WI
Congratulations to all of you!
Oh, and thanks for acknowledging our anniversary. Sigh …