• New Article: Send an Instant Message from a Script

    Here it is, the script you’ve all been waiting for: send an instant message from a script. What? You say that’s not the script you’ve been waiting for? Oh. Well, here it is anyway. We’ve actually included four different scripts in this article that show you how to automatically send instant messages to different sets of contacts in Microsoft Lync 2010.

     

    These scripts make use of the Microsoft Lync 2010 SDK and work against the currently running instance of Lync on the local machine. The scripts themselves are pretty short and simple, and could come in handy in many different situations. We’re certain some of you can come up with plenty of uses for them. Well, almost certain.

     

    http://blogs.technet.com/b/csps/archive/2011/05/05/sendim.aspx

     

  • Haiku #118

    Let sleeping cats lie.

    Instead, make changes using

    CS Registrar.

     

    Why yes, as a matter of fact, the author of today's haiku is a bit tired this morning. Thank you for asking.

     

    Coincidentally, the author of today's haiku and his wife are babysitting a cat for the next three weeks. How hard could it be to take care of a cat? Well, it's not hard at all to take care of a cat. But taking care of this cat is a different story.

     

    Not that we're dealing with a bad cat here; on the contrary, this cat seems pretty nice, and even sort of likes people. (Although we had to promise not to tell other cats that.) However, she does have … interesting … sleeping habits. For example, Monday morning she woke up at 4:00, which would be fine except that she enthusiastically tried to get everyone else in the house to get up and join her in whatever cats and people do at 4:00 AM on a Monday.

     

    Note. Whatever it is, it's not fun. Nothing is fun at 4:00 AM on a Monday.

     

    Last night the author of today's haiku was doing a little in-bed reading when the cat hopped on the bed and nestled up against him. Sweet, huh? Except that the cat went to sleep and refused to move. That might have been fine, except that it was a little stuffy in the room last night, and the author of today's haiku began roasting under the combined warmth of the bed covers and the cat. He couldn't peel back some of those covers, because he had a sleeping cat on one side and a sleeping wife on the other side. Eventually he managed to wriggle his way outside the covers, which bought him about 15 minutes of relief until he then started to get a little cold. And then – well, you get the idea. The whole thing continued on its merry way until the cat got up around 4:30 AM (slept in today!), which gave the author of today's haiku the chance to get back into bed, with the right amount of covers, and then try to cram an entire night's sleep into an hour and a half.

     

    It didn't work.

     

    At any rate, the point of all that is just to point out that if today's haiku seems a little disjointed and doesn't make a lot of sense, well, there's a good reason for that: the author of today's haiku is a bit tired this morning.

     

    Note. And why don't any of the other haikus make a lot of sense? Hmmm ….

     

    Fortunately, we found a sure-fire way to get the blood flowing again no matter how tired you might be: just start playing around with the Set-CsRegistrar cmdlet. As you might expect, Set-CsRegistrar provides a way for you to configure and manage your Registrars. As you might also expect, this includes doing such exciting things as configuring the ports used for Web service or SIP traffic. For example:

     

    Set-CsRegistrar –Identity "Registrar:atl-cs-001.litwareinc.com" -SipPort 5072

     

    That does get the heart pounding a little bit, doesn't it? What we thought we'd focus on today, however, is something that might be even more exciting than SIP ports: failover and failback.

     

    Did we say "failover and failback?" You bet we did. Microsoft Lync Server 2010 provides a way for users to automatically be redirected to a backup Registrar any time their primary Registrar is unavailable. What does that mean? Well, suppose you're homed on atl-cs-001.litwareinc.com. You try to log on to Microsoft Lync, but atl-cs-001.litwareinc.com is unavailable for some reason. If you've configured a backup registrar for that pool (for example, atl-backup-001.litwareinc.com) then you have nothing to worry about: you'll automatically be redirected to, and be able to log on to, that backup registrar.

     

    Note. With a few limitations. When you're logged on to a backup Registrar there are a few features – voice mail, and the ability to modify your call forwarding settings are two that come to mind – won't be available to you.

     

    Excited? We thought you would be. To allow for this automatic failover, you need to do two things: enable failover in the first place, and specify a backup registrar. How do you that? That's right: you use the Set-CsRegistrar cmdlet. In other words:

     

    Set-CsRegistrar -Identity "Registrar:atl-cs-001.litwareinc.com" -BackupRegistrar "Registrar:atl-backup-001.litwareinc.com" -EnableAutomaticFailover $True

     

    And while you're at it, there are two other properties you might find useful. The first – FailoverDetectionInterval – specifies how long the system will wait before deciding that a Registrar is not available. (Lync Server periodically sends "heartbeat" messages to its Registrars to verify that they're still up and running.) If the detection interval has passed and a Registrar still has not responded to the heartbeat message, then the system will "failover," which simply means that Lync Server will begin directing users to the backup Registrar.

     

    The other property of interest is FailbackDetectionInterval. Let's suppose a Registrar is unavailable, and you've been "failed over" to the backup Registrar. That works but, as we noted, there are some limitations: the complete Lync Server feature set is not available to you when you're working on a backup Registrar. Because of that, the ideal situation is for you to move off the backup Registrar as soon as the primary Registrar is back in business. The FailbackDetectionInterval property specified the amount of time Lync Server waits before checking to see if the primary Registrar is available. If it is, then users homed on that Registrar will see their sessions "failed back;" that simply means that users on the backup Registrar will be re-registered on their home Registrar.

     

    Which is actually pretty cool.

     

    Two quick notes about Set-CsRegistrar. First, there is no corresponding Get-CsRegistrar cmdlet. Does that mean that you can't retrieve information about how your Registrars are currently configured? No. It just means that you have to use the Get-CsService cmdlet instead:

     

    Get-CsService –Registrar

     

    Second, the Set-CsRegistrar cmdlet doesn't accept pipelined input; that means you can't run a command like this one and configure all your Registrars at the same time:

     

    Get-CsService -Registrar | Set-CsRegistrar -SipPort 5072

     

    But now that you mention it, there is a way to work around that: instead of directly piping the Registrar data to Set-CsRegistrar, pipe it to the ForEach-Object cmdlet instead:

     

    Get-CsService -Registrar | ForEach-Object {Set-CsRegistrar -Identity $_.Identity -SipPort 5072}

     

    Give that a try and see what happens.

     

    As for the cat sitting, well, we'll see what happens. As it turns out, cats (who typically sleep as many as 16 hours a day) are "crepuscular," which means that they are most active at dawn and at dusk. Is "crepuscular" what the author of today's haiku called "his" cat at 4:00 in the morning? Uh, sure, yeah …. Crepuscular ….

     

     

  • Haiku #107

    I'm sorry that I

    Didn't call. You can blame my

    Access policy.

     

    In case you haven't been following the news lately, in the past couple of weeks the New York state Department of Health issued guidelines for summer camps, guidelines that include a list of activities deemed too dangerous for children to participate in. Among the activities on that list: kickball, Wiffle ball, and freeze tag.

     

    Just in case you aren't familiar with freeze tag, freeze tag a variation on the good old-fashioned game of tag. In plain old tag (which apparently is not too dangerous for children to participate in) one person (known as "it," although not be to confused with Cousin It) runs around and tries to tag the other people in the game. If you get tagged, then you become it.

     

    Note. Now that you mention it, while it might not be dangerous it does sound kind of stressful, doesn't it? Those poor kids.

     

    In freeze tag, people who get tagged don't become it. Instead, they have to freeze; that is, they have to remain motionless at the very spot where they were tagged, at least until another player comes along and unfreezes them. To "unfreeze" someone all you have to do is touch them. Apparently something in the freezing/unfreezing process is too dangerous for most people. Unless you are a highly-trained freeze tag professional, do not try that home.

     

    Note. Does the author of today's haiku agree that freeze tag is a dangerous activity? No, not really. After all, he sits motionless in the same spot at work every day, not doing anything, not even moving a muscle, and he never seems to get hurt.

     

    Well, unless you count his annual performance review.

     

    So if you can't play freeze tag or Wiffle ball (Wiffle ball!) in the state of New York what can you do? To be honest, we don't have a complete list of the acceptable activities, although we do know that Frisbee is considered safe. (Despite this study, which appeared in the Wisconsin Medical Journal.) Also considered safe (as far as we know, anyway) is this: running the CsExternalAccessPolicy cmdlets. Which is obviously a good thing to know: after all, later this summer, when the kids are just lying around playing video games, you can tell them, "Kids, it's a beautiful day today. Go outside and run the CsExternalAccessPolicy cmdlets." No doubt they'll complain at first. But once they've gone outside and started playing around with the CsExternalAccessPolicy cmdlets, well, then they'll be singing a different tune.

     

    Note. Here at Microsoft, the CsExternalAccessPolicy cmdlets – Get-CsExternalAccessPolicy, Grant-CsExternalAccessPolicy, New-CsExternalAccessPolicy, Remove-CsExternalAccessPolicy, and Set-CsExternalAccessPolicy – are informally known as the "Freeze Tag of Microsoft Lync Server 2010."

     

    So what's there to love about the CsExternalAccessPolicy cmdlets? A better question would be this: what isn't there to love about the CsExternalAccessPolicy cmdlets? As the name implies, the CsExternalAccessPolicy cmdlets provide a way for you to manage your external access policies. What are external access policies? Well, suppose you've set up your Edge Servers and you've enabled federation and set up all your allowed domains and purchased any licenses you might need to communicate with public instant messaging services and done all the other stuff that you might need to do to allow your users to communicate with the outside world (or simply to log on from the outside world; that is, from outside your organization's firewall). Does that mean that now your users can communicate with the outside world? No. That's because the ability of individual users to communicate with the outside world (or to log on from outside the internal network) is controlled by external access policies. And, by default, the global external access policy prohibits all these activities.

     

    Note. No, as far as we know, the New York state Department of Health did not write the global external access policy. But it does seem like more than just a coincidence, doesn't it?

     

    If you want to extend some of these capabilities to your users, you'll need to either modify the global external access policy, or create some new external access policies. (These policies can be created at either the site scope or the per-user scope.) When working with an external access policy, you have four key properties available to you:

     

    ·         EnableFederationAccess. When set to True, this allows users to communicate with users from a federated organization.

    ·         EnableOutsideAccess. When set to True, this allows users to log on to Lync Server over the Internet, and without having to first log on to the internal network.

    ·         EnablePublicCloudAccess. When set to True, this allows users to exchange instant messages with people who have SIP accounts on a public Internet connectivity provider such as MSN or AOL.

    ·         EnablePublicCloudAudioVideoAccess. When set to True, this allows users to conduct audio/video conversations with people who have accounts on a public Internet connectivity provider.

     

    Pretty cool, huh? So let's say you want all your users to have all these capabilities. How can you do that? Simply by using Set-CsExternalAccessPolicy to modify the global external access policy:

     

    Set-CsExternalAccessPolicy -Identity global –EnableFederationAccess $True –EnableOutsideAccess $True – EnablePublicCloudAccess $True –EnablePublicCloudAudioVideoAccess $True

     

    Your kids are going to love this!

     

    And because you can create new policies at the site scope or the per-user scope, you can do all sorts of other fun things with the CsExternalAccessPolicy cmdlets. For example, suppose you'd like all your users to be able to log on via the Internet, but you only want the Sales department to be able to communicate with federated users. How can you do that? Well, first, you can modify the global policy to allow outside access:

     

    Set-CsExternalAccessPolicy -Identity global–EnableOutsideAccess $True

     

    After you've done that, you can create a new per-user policy that allows both outside access and federation access:

     

    New-CsExternalAccessPolicy -Identity SalesExternalAccessPolicy –EnableFederationAccess $True –EnableOutsideAccess $True

     

    And then all you have to do is use the Grant-CsExternalAccessPolicy cmdlet to assign the new policy to the appropriate users. For example, this command assigns the new policy to every person in the Sales department:

     

    Get-CsUser –LdapFilter "Department=Sales" | Grant-CsExternalAccessPolicy –PolicyName SalesExternalAccessPolicy

     

    Hey, who even needs Wiffle ball, right?

     

    Note. Well, OK, the author of today's haiku does: he still plays Wiffle ball any chance he gets. But most people probably can get by without it now that they now about the CsExternalAccessPolicy cmdlets.

     

    While we're at it, here's a little tip that might come in handy. By default, Microsoft Lync requires encryption for all audio/video conversations. That can be a problem if you enable public cloud audio/video: some of these public Internet services don't support audio/video encryption. If you try to start an audio/video conversation with someone on one of these services, the call will fail, and an event will be recorded on the Front End Server telling you that the encryption levels don’t match.

     

    So is there a way to work around this? As a matter of fact, there is. Just modify Lync Server so that encryption is supported, but isn't required:

     

    Set-CsMediaConfiguration –Identity global –EncryptionLevel SupportEncryption

     

    Is it a good thing or a bad thing to no longer require encryption? That's something you'll have to decide for yourselves.

     

    So there you have it: the CsExternalAccessPolicy cmdlets. Twice as much fun as freeze tag, and nowhere near as dangerous! See you tomorrow.

     

     

     

  • Haiku #112

    Let's go fly a kite

    Up to the – nah, we'd rather

    Do holiday sets.

     

    This past weekend the author of today's haiku went to see the musical version of Mary Poppins.

     

    Note. Don't be surprised: technically they wouldn't let him in the door to see the show. He snuck in the through a window when no one was looking.

     

    All in all the show was pretty good: considering that they included all the songs from the original movie, it would be pretty hard for it not to be good. However, in the musical they did sing the songs in a very different order from the movie. Let's Go Fly a Kite coming smack dab in the middle of the show? As a parent, and thus as someone who has seen Mary Poppins several thousand times, that was a little discombobulating.


    How discombobulating? Well, imagine this: Suppose we took a typical Lync PowerShell daily haiku, cut out all the paragraphs, then reassembled those paragraphs in random order. You'd end up with sheer nonsense: an article that had no clarity or coherence, an article that seemingly had nothing to do with either haikus or Lync Server PowerShell, an article that –

     

    Well, OK: bad example. But you know what we mean.

     

    If you, too have seen the movie several thousand times then you no doubt remember the horse racing scene. Mary Poppins wins the race (no surprise, seeing as how she is practically perfect in every way) and is immediately surrounded by reporters. One of the reporters remarks that Mary is probably at a loss for words after her rousing victory, but Mary tells them that she actually has the perfect word for an occasion such as this: CsRgsHolidaySet.

     

    Note. OK, granted that might not sound like the perfect word for any occasion. But try singing it in Julie Andrews' voice. Trust us: it’ll sound a lot better.

     

    Unlike a common everyday word like supercalifragilisticexpialidocious (which means "something to say when you have nothing to say"), you might not be familiar with CsRgsHolidaySet. As it turns out, CsRgsHolidaySet is the noun used with a family of Lync Server PowerShell cmdlets: Get-CsRgsHolidaySet, New-CsRgsHolidaySet, Remove-CsRgsHolidaySet, and Set-CsRgsHolidaySet. And what does that family of Lync Server PowerShell cmdlets allow you to do? We have no idea.

     

    No, wait: just kidding. We know exactly what those cmdlets do: they enable you to manage Response Group holiday sets.

     

    And here's an unexpected bonus: we even know what a Response Group holidays set is. Unlike the Lync Server PowerShell blog, which is fully-staffed around the clock 365 days – no, wait 385 days a year! – some organizations actually give their employees a day off every now and then. As for as the Response Group application is concerned, these days off are known as holidays. What difference does it make to the Response Group application if an organization gives everyone a day off every now and then? Well, what happens is this: if you call a number associated with a Response Group workflow, one of the things the Response Group application will do is check to see if today happens to be a holiday. If so, then the system can be configured to do something like automatically transfer the call to voice mail, ensuring that the phone doesn't just ring and ring and ring even though no one is there to answer it.

     

    So how do you create one of these holiday sets? Well, for starters, you first need to create a holiday: Lync Server won't let you create a holiday set that doesn't include at least one holiday. (Which makes sense: who needs a holiday set that doesn't contain any holidays?) Here's a sample command that creates a holiday and stores that holiday in the variable $x:

     

    $x = New-CsRgsHoliday –Name "Holiday 1" –StartDate "7/12/2011" –EndDate "7/13/2011"

     

    Note. If you aren't sure what that command actually does, then you might want to take another peek at haiku No. 73.

     

    Yes, that haiku No. 73.

     

    As soon as we have a holiday we can then create a holiday set. This particular set is going to be used for our help desk: we're going to give those folks July 12th off. Needless to say, different groups in your organization might have different holidays: although the help desk gets July 12th off, maybe the customer support people don't. And that's fine: assuming that each of these groups has its own Response Group workflow all you have to do is create separate holiday sets for each one.

     

    But we digress. Here's a command that creates a new holiday set and adds the holiday we stored in $x to that set:

     

    New-CsRgsHolidaySet -Parent "service:ApplicationServer:atl-cs-001.litwareinc.com" -Name "Help Desk Holidays" -HolidayList($x)

     

    See? Nothing to it. We created a new holiday set named Help Desk Holidays, and added a single holiday to it. What if we wanted to add multiple holidays to that holiday set? That's fine. All we'd have to do is create another holiday, storing that holiday in a different variable:

     

    $y = New-CsRgsHoliday –Name "Holiday 2" –StartDate "12/19/2011" –EndDate "12/20/2011"

     

    And then we can add both holidays using the same command:

     

    New-CsRgsHolidaySet -Parent "service:ApplicationServer:atl-cs-001.litwareinc.com" -Name "Help Desk Holidays" -HolidayList($x,$y)

     

    Or, if we created a bunch of holidays, we could add a bunch of holidays with a single command:

     

    New-CsRgsHolidaySet -Parent "service:ApplicationServer:atl-cs-001.litwareinc.com" -Name "Help Desk Holidays" -HolidayList($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k)

     

    And yes: we'd like to work for a company that gave employees that many days off, too.

     

    Pretty cool, huh? Now, suppose we decide to add a new holiday to an existing holiday set; how do we do that? Admittedly, it's a little tricky, but this will work:

     

    $z = New-CsRgsHoliday –Name "Holiday 3" –StartDate "12/18/2011" –EndDate "12/19/2011"

     

    $holidaySet = Get-CsRgsHolidaySet –Name "Help Desk Holidays"

    $holidaySet.HolidayList.Add($z)

     

    Set-CsRgsHolidaySet –Instance $holidaySet

     

    So what all did we do here? Well, for starters, we created our third holiday and stored it in the variable $z. We then used this command to retrieve an object reference to our holiday set, storing that object reference in a variable named $holidaySet:

     

    $holidaySet = Get-CsRgsHolidaySet –Name "Help Desk Holidays"

     

    After that we used the Add method to add the holiday $z to the set, and then, last but surely not least, used the Set-CsRgsHolidaySet cmdlet to write those changes back to the Response Group application.

     

    A little goofy, but it works.

     

    We can also use a somewhat similar approach to remove a holiday (in this case, Holiday 3) from an existing set:

     

    $holidaySet = Get-CsRgsHolidaySet –Name "Help Desk Holidays"

    $holidaySet.HolidayList.Remove("Holiday 3")

     

    Set-CsRgsHolidaySet –Instance $holidaySet

     

    And if Ebenezer Scrooge ever buys out your company you can use a command like this one to remove all the holidays from a holiday set:

     

    $holidaySet = Get-CsRgsHolidaySet –Name "Help Desk Holidays"

    $holidaySet.HolidayList.Clear()

     

    Set-CsRgsHolidaySet –Instance $holidaySet

     

    You know, that's what we said: Bah! Humbug.

     

    As you might expect, you can always use Remove-CsRgsHolidaySet to completely remove a holiday set, or use Get-CsRgsHolidaySet to return information about your existing holiday sets. In fact, here's an interesting command. You say you want to know if any of your holiday sets still show December 18th as a holiday? Here's a way to return the names of any holiday set that includes 12/18/2011 as a holiday:

     

    Get-CsRgsHolidaySet | Select-Object Identity -ExpandProperty HolidayList | Where-Object {$_.StartDate -match "12/18/2011"} | ForEach-Object {Get-CsRgsHolidaySet -Identity $_.Identity} | Select-Object Name

     

    By the way, there's one tricky little thing we uncovered by accident when playing around with this cmdlet. (At least when working with a US English system.) Suppose you want to know if there are any holiday sets that include 12/8 as a holiday. Believe it or not, this command won't return any date (note the highlighted text):

     

    Get-CsRgsHolidaySet | Select-Object Identity -ExpandProperty HolidayList | Where-Object {$_.StartDate -match "12/8/2011"} | ForEach-Object {Get-CsRgsHolidaySet -Identity $_.Identity} | Select-Object Name

     

    Instead, you need to specify a date like 12/8/2011 this like:

     

    12/08/2011

     

    In other words:

     

    Get-CsRgsHolidaySet | Select-Object Identity -ExpandProperty HolidayList | Where-Object {$_.StartDate -match "12/08/2011"} | ForEach-Object {Get-CsRgsHolidaySet -Identity $_.Identity} | Select-Object Name

     

    And what if you had a date like 1/8/2011? That needs to be formatted like this:

     

    1/08/2011

     

    In other words, you need to put a leading zero before a single-digit day, but you don't have to preface the month with a leading zero. Why not? About all we can say is this: supercalifragilisticexpialidocious.

     

    Which is what you say when you have nothing else to say.

     

     

     

  • Haiku #121

    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.