The name says it all:

Set Mediation Server.

Sheer poetry, eh?

 

OK, we concede: we have met our match. Up to this point we assumed that the Lync Server PowerShell Haiku of the Day represented the finest poetry being written anywhere in the world. But then we received the following email in our Junk Mail folder:

 

you probably don't     remember me

   but i saw your picture on facebook

we have never  met but I sawyour

picture on facbook

                         do you rememember all the good times we had

we can have those go

od times again

         please click the link below

sorry but I     don't have a face

book account so   click the link below

   i cannot wait to see you again

 

That's exactly how the email looked, including the clever use of line breaks, the design-inspired extraneous white spaces, and the creative spelling. (And no uppercase letters or punctuation: that's how you know you're dealing with good poetry.) And then there are the deeply-profound questions that were raised: Rememember all the good times we had, even though we have never met? I saw your picture on facebook even though I don't have a face book account?

 

Needless to say, when you read that email your first thought is, "I must be missing something here; this must have been written by an artistic genius and I simply don't understand it. After all, nobody could write something that makes that little sense, could they?"

 

Wait, never mind: that's what people think when they read the Lync Server PowerShell Haiku of the Day. Compared to the daily haiku, the email we got actually seems pretty straightforward. At least the email kind of makes sense.

 

Kind of.

 

At any rate, we tip our hats to this unknown poet (the email was unsigned and the poet doesn't have a facbook account, so we didn't know how to track the author down). We admit it: he or she clearly has us beat when it comes to sheer poetry. Fortunately for us, however, we still have the one important item that all the great poets, from William Shakespeare to Lord Byron to Robert Frost, have always had: information about Microsoft Lync Server 2010 PowerShell!

 

Note. OK, not that we've actually had any information about Lync Server PowerShell today, not yet anyway. But we were just about to get to all that.

 

Today we thought we'd talk about the Set-CsMediationServer cmdlet. Why? Two reasons. For one, it's one of the rare Lync Server PowerShell cmdlets that Samuel Taylor Coleridge never discussed in his poems. (No, we checked; not even in The Rime of the Ancient Mariner.) Second, we have a meeting not too long from now, and we needed a cmdlet that we could dispose of quickly and easily. Set-CsMediationServer definitely fulfilled that second requirement.

 

But mostly we wanted to try and top Samuel Taylor Coleridge.

 

Note. Although we have to give Coleridge credit. The Rime of the Ancient Mariner is divided into 7 parts, and the parts all have titles like these:

 

Part the First

Part the Second

 

We're kicking ourselves for not thinking of that before Coleridge did. If we had, then this would be Haiku the 121st instead of Haiku #121. First an unknown poet from Bulgaria or some place like that, and then Samuel Taylor Coleridge. Isn't there a poet anywhere in the world that we're better than?!?

 

Um, you know you really didn't have to answer that question.

 

But hey, let's talk about Set-CsMediationServer. As you probably know, the Mediation Server acts as a sort of middleman between your internal Enterprise Voice network and the external Public Switched Telephone Network (the infamous PSTN). Mediation Server offers one way for your Enterprise Voice users to be able to communicate with people using (gasp!) old-fashioned landline phones, cell phones, or any other device connected to the PSTN.

 

Which, needless to say, is a pretty nice little feature to have at your disposal.

 

As you might expect, the Set-CsMediationServer cmdlet is used for managing and configuring your Mediation Servers; if it wasn't used for that they probably would have given it a very different name. Generally speaking, managing a Mediation Server means doing one of two things: 1) configuring the ports used for such things as audio, TCP, and TLS traffic; and, 2) associating the Mediation Server with a particular Registrar and/or Edge Server. For example, here's a command that assigns a Mediation Server to the Registrar atl-cs-001.litwareinc.com:

 

Set-CsMediationServer -Identity "MediationServer:atl-media-001.litwareinc.com"  -Registrar "atl-cs-001.litwareinc.com"

 

And here's a command that assigns port 5068 to the SIP client TCP port, the port used for communicating with gateway peers via the TCP protocol:

 

Set-CsMediationServer -Identity "MediationServer:atl-cs-001.litwareinc.com" -SipClientTcpPort 5068

 

Needless to say, there's nothing too terribly difficult about that.

 

In fact, there's nothing too terribly difficult about any of the parameters used with Set-CsMediationServer; instead, there are just a few things to be aware of.

 

Like what, you ask? Well, let's start with this: if you change a port on a Mediation Server, that change won't take effect until the Mediation Server service has been restarted. That has nothing to do with the Set-CsMediationServer cmdlet; that's just the way the service itself works.

 

Second, note that there's no Get-CsMediationServer cmdlet. Does that mean you can't retrieve the current settings for your Mediation Servers? Nope; it just means you have to use the Get-CsService cmdlet, like so:

 

Get-CsService –MediationServer

 

And then there's this: the Set-CsMediationServer cmdlet doesn't accept pipelined input. Does that make any difference to us? Well, it might. After all, suppose you want to assign port 5068 to all your Mediation Servers. In that case, you might expect a command like this one to work:

 

Get-CsService | Set-CsMediationServer -SipClientTcpPort 5068

 

Unfortunately, that command won't work. Instead, you'll just get an error message similar to this:

 

Set-CsMediationServer : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

 

What does that mean? Beats us. About all we do know is that the only way to change a bunch of Mediation Servers using a single command is to pipe the data to the ForEach-Object cmdlet instead:

 

Get-CsService | ForEach-Object {Set-CsMediationServer –Identity $_.Identity -SipClientTcpPort 5068}

 

That should do the trick.

 

And that should also do it for today: not only do we have a meeting to attend, but we also have to brush up on our poetry a bit. Are we going to let some unknown poet from Bulgaria beat us? Well, now that you mention it, yes, we are. But we still think we can top Samuel Taylor Coleridge:

 

My sire is of a noble line,

And my name is Geraldine:

Five warriors seized me yestermorn,

Me, even me, a maid forlorn:

 

Come on now: rhyming noble line and Geraldine? And ”yestermorn"? Is that even a word? We can definitely take Coleridge. Any day of the week.