Haiku #104

My PSOM

Data port? There's no way to

Change that port! Unless ....

 

Hey, everyone: happy Cinco de Mayo. As you may or may not know, May 5th is Cinco de Mayo, a holiday that marks the Mexican army's stunning defeat of the French in the Battle of Puebla in 1862. Contrary to popular belief, Cinco de Mayo (which is Spanish for … uh, well, it's Spanish) is not the same thing as Mexican Independence Day; Mexican Independence Day actually occurs sometime in September. It's also not, as one local news commentator recently reported, "Hispanic Independence Day."

 

Which, we presume, would have to mark the day that the country of Hispania won its independence.

 

And here's an interesting piece of trivia for you: although Cinco de Mayo marks the occasion of a great victory by the Mexican army, the holiday is actually celebrated much more widely in the US than it is in Mexico. In the US, it's a big deal; in Mexico, celebrations are mainly limited to the state of Puebla.

 

Of course, we're sure that has nothing to do with America's penchant for taking any occasion and turning it into a day of joy and celebration. As well as a day when companies can sell you stuff you had no idea you needed to buy.

 

Note. Although we have to admit that the taco costume would look equally good on any day of the year, not just on Cinco de Mayo. As would the Drinko de Mayo T-shirt.

 

Of course, by now you're probably wondering, "What does Cinco de Mayo have to do with Lync Server PowerShell?" Well, the answer to that question will surprise you. No, wait, check that: what would surprise you is if we actually had an answer to that question. Seeing as how we don't, let's just ignore all this Cinco de Mayo stuff and get down to the real subject of today's haiku: the Set-CsEdgeServer cmdlet.

 

Note. Interestingly enough, the Set-CsEdgeServer cmdlet is also not widely celebrated in Mexico. Go figure, huh?

 

As you already know, Edge Servers serve as an intermediary between your internal network and the outside world.

 

Note. How do we know that you already know that? Because when we were writing the Lync Server PowerShell help we included a sentence like that one to describe Edge Servers as an intermediary between your internal network and the outside world, and we were told we should take that out because "Everyone already knows that."

 

At any rate, if you're doing something like trying to log on to Lync Server from the Internet, you typically connect to the Edge Server and rely on the Edge Server to communicate with a Front End Server. As a general rule, you don't have people on the Internet directly accessing your internal network. Which is actually a pretty darn good rule to follow.

 

As you can probably guess, the Set-CsEdgeServer cmdlet is used to modify the settings of one or more Edge Servers. For the most part, that means configuring the ports used for different types of network traffic. Edge Servers handle a lot of different traffic types: TCP traffic, UDP traffic, PSOM (Persistent Shared Object Model) traffic, etc., etc. Each traffic type must be assigned one or more ports, and these port assignments can be made by using the Set-CsEdgeServer cmdlet.

 

An example? Sure, we can show you an example. Suppose you want to set the PSOM client port to port 443. How do you do that? Like this:

 

Set-CsEdgeServer -Identity "EdgeServer:atl-edge-001.litwareinc.com" –DataPsomClientPort 443

 

Note. Yes, considering how easy that was it is somewhat surprising that the Set-CsEdgeServer cmdlet isn't more-widely celebrated in Mexico. Or anywhere else, for that matter.

 

What if you want to set the PSOM client port for all your Edge Servers? Well, admittedly, that's a little tricky: the Set-CsEdgeServer cmdlet doesn't accept pipelined input, which means that a command like this one won't work:

 

Get-CsService –EdgeServer | Set-CsEdgeServer –DataPsomClientPort 443

 

Note. Now that you mention it, we should have mentioned that the only way to view the current settings for your Edge Servers is to use the Get-CsService cmdlet and the EdgeServer parameter:

 

Get-CsService –EdgeServer

 

For some reason, and we aren't sure what that reason is, there is no Get-CsEdgeServer cmdlet.

 

But don't despair: not only is today Cinco de Mayo (and if you’re still looking for a reason to celebrate, try this), but there's a way to work around this issue. If you want to set the PSOM client port for all your Edge Servers, do this:

 

Get-CsService –EdgeServer | ForEach-Object {Set-CsEdgeServer –Identity $_.Identity –DataPsomClientPort 443}

 

What we're doing here is using Get-CsService to return a collection of all our Edge Server settings. From here, however, we don't pipe the collection to Set-CsEdgeServer; that would be pointless, seeing as how Set-CsEdgeServer won't accept pipelined input. Instead, we pipe the data to the ForEach-Object cmdlet, which dutifully calls Set-CsEdgeServer for each of the servers in the collection.

 

Yeah, we thought that was kind of sneaky, too. But it works.

 

There's really only one other thing to keep in mind here. If you decide to modify the media communication port, you'll have to deal with two parameters: MediaCommunicationPortStart and MediaCommunicationPortCount. Media communications can (and should) be assigned multiple ports. To do that, you use MediaCommunicationPortStart to assign the first port in the series of ports to be used for media communications, then use MediaCommunicationPortCount to determine the total number of ports to be used for this traffic. For example, suppose you want to assign media communications to ports 50000 through 50003. (That's really not enough ports, but this is just an illustration.) That means you want to use a total of 4 ports:

 

· 50000

· 50001

· 50002

· 50003

 

Consequently, you need to use a command like this one:

 

Set-CsEdgeServer -Identity "EdgeServer:atl-edge-001.litwareinc.com" –MediaCommunicationPortStart 50000 –MediaCommunicationPortCount 4

 

As you can see, we set the starting port number to port 50000, and the total number of ports to 4. It's not hard, just something that you have to keep in mind.

 

That's all we have for today; again, happy Cinco de Mayo to everyone. Is the author of today's haiku enjoying his Cinco de Mayo? Well, let's put it this way: he's sitting at his desk writing Lync Server PowerShell haikus.

 

Which, come to think of it, is how he spends all his holidays.