Haiku #130
Published May 20 2019 03:40 PM 1,181 Views
Occasional Visitor
First published on TECHNET on Jun 13, 2011

Cmdlets for route

Configuration? You can

Use them to … uh … um …

Happy Monday, everyone! We're pretty excited and pretty jazzed up this morning, because this has the makings of an absolutely great week! Why do we say that? Well, here are just a few reasons:

· Last night the cat that the author of today's haiku is still cat-sitting decided it would be fun to see how many people in the house could stay up all night, without getting any sleep whatsoever. How fun was that? Just about as much fun as you'd expect it would be. Whoo-hoo!

· Last night (definitely a big night last night) the Seattle area got smacked with a little hail/sleet/whatever. Is it fair that people in the Seattle area get all sorts of fun and interesting summer weather – like being able to wake up in the morning and see ice pellets out on the lawn – while other people in the world just get boring old hot weather during their summers? Hey, too bad: after all, no one is stopping you from moving here, are they?

In fact, right about now the author of today's haiku would be willing to make you a heck of a deal on his house.

· This week is performance review week here at Microsoft: it's time for everyone to fill out their annual performance review. This year's review promises to be one that tops all the previous years' reviews, and by a longshot. How can we be so sure of that? Well, in the past, Microsoft rated performance using a scale where 1 was the lowest score and 5 was the highest score. No one liked that system, so we got rid of it a few years ago and went to a system in which you didn't get a numerical rating at all. Ah, but this year, we've switched gears and implemented a brand-new system, one in which 5 is the lowest score and 1 is the highest score!

You know all those people who say that Microsoft has lost its ability to innovate? Well, what do you say now ?!?

That’s what we said: whew! But just when you're thinking, "Wow, this week couldn't possibly get any more exciting, could it?", well, guess what: this week can get even more exciting. After all, and on top of everything else, today we're going to talk about  the CsRoutingConfiguration cmdlets!

So what's so exciting about the CsRoutingConfiguration cmdlets? Well, let's see, where do we start? There's the fact that … um, OK, well, forget that. Well, you can always use these cmdlets to … uh, never mind. Oh, wait, you could – no, you'd never want to do that , that's for sure. OK, as it turns out, there's nothing the least bit exciting about the CsRoutingConfiguration cmdlets. In fact, there's a good chance you'll never want to use these cmdlets.


We were afraid someone was going to ask that: if there's a good chance that you'll never want to use these cmdlets then why do these cmdlets even exist in the first place? Well, to be honest, we can't provide you with the nitty-gritty details; we only know that Lync Server itself makes use of these cmdlets. But unless you happen to be an instance of Lync Server then you probably won't have much use for them.

Why not? Well, what the CsRoutingConfiguration cmdlets do is enable you to manage your voice route collections. And yes, that does sound like a valuable tool, except for one thing: in Microsoft Lync Server 2010 you can only have a single, global collection of voice routes. That makes the New-CsRoutingConfiguration cmdlet somewhat less-than useful: for example, you can only use New-CsRoutingConfiguration to create a new global voice route collection, which would be fine except that you can't actually create a new voice route collection. If you try, you'll get this error:

New-CsRoutingConfiguration : "RoutingConfiguration" with identity "Global" already exists. To modify the existing item, use the Set- cmdlet. To create a new item, use a different identity.

That sounds reasonable, but if you try to create a voice route collection using a different identity ( any identity) you get an error message like this one:

New-CsRoutingConfiguration : Cannot create item at thus location. Create new item at scopes: "global"

But then if you try to create a new voice route collection at the global scope – well, you get the idea. It won't work. Pretty much the only thing you can do with New-CsRoutingConfiguration is this: Suppose you deleted all your voice routes and now your global voice routing collection is empty. To restore that collection to its default value (that is, the restore the default voice route) you can use these two commands:

$x = New-CsRoutingConfiguration –Identity global –InMemory

Set-CsRoutingConfiguration –Instance $x

How often will that come up? To be honest, it probably won’t come up very often.

And even if it did , you can achieve the exact same thing by using the Remove-CsRoutingConfiguration cmdlet instead (and by using just one command). As the name implies, Remove-CsRoutingConfiguration provides a way for you to remove voice routing collections … or at least it would if you could actually create voice routing collections. Because you can't, the only thing you can do with Remove-CsRoutingConfiguration is delete the global collection. And you're right: Lync Server won't let you delete the global collection. Which means that the only thing Remove-CsRoutingConfiguration can do is reset the global collection to its default value. If you ever want to delete all your voice routes and restore your global voice routing collection to its default value, well, this will work:

Remove-CsRoutingConfiguration -Identity global


Theoretically, you could use Set-CsRoutingConfiguration to modify an existing voice route. So why wouldn't you want to do that? Well, Set-CsRoutingConfiguration requires a sort of roundabout approach to modifying a voice route:

$a = Get-CsRoutingConfiguration

$b = $a.Route | Where-Object {$_.Name -match "LocalRoute"}

$b.SuppressCallerId = $False

Set-CsRoutingConfiguration -Instance $a

That works, but you can do the exact same thing way, way easier simply by using the Set-CsVoiceRoute cmdlet:

Set-CsVoiceRoute -Identity LocalRoute -SuppressCallerId $False

If you enjoy typing then maybe Set-CsRoutingConfiguration is the way to go. Otherwise ….

Finally, there's Get-CsRoutingConfiguration, which will return all the voice routes in the global collection. Well, sort of. For one thing, those routes will be all jammed together unless you retrieve the collection and then pipe it to the Select-Object cmdlet:

Get-CsRoutingConfiguration | Select-Object –ExpandProperty Route

That works, but you might find it a bit easier just to use Get-CsVoiceRoute instead:


Not only does that require less effort, but you actually get back more information using Get-CsVoiceRoute. Get-CsVoiceRoute returns these property values:

· Identity

· Priority

· Description

· NumberPattern

· PstnUsages

· PstnGatewayList

· Name

· SuppressCallerId

· AlternateCallerId

By comparison, Get-CsRoutingConfiguration only returns these property values:

· Description

· NumberPattern

· PstnUsages

· PstnGatewayList

· Name

· SuppressCallerId

· AlternateCallerId

So there you have it: the CsRoutingConfiguration cmdlets. These cmdlets work (well, for the most part) but, despite that, they don't really seem to serve any useful purpose, and you have to wonder why Microsoft even keeps them around.

And yet, for some reason, the author of today's haiku has a soft spot in his heart for the CsRoutingConfiguration cmdlets, and seems to identity with them. Go figure.

Version history
Last update:
‎May 20 2019 03:40 PM
Updated by: