Share via


Haiku #108

Sunshine? Bah! We have

Interface cmdlets to

Brighten up our days.

 

To begin with, we'd like to reassure everyone that, after the crazy day we had yesterday, everything appears to be back to normal this morning. What was so crazy about yesterday? Well, for one thing, when the author of today's haiku left work yesterday afternoon, the temperature was approximately 61 degrees Fahrenheit.

 

Note. We say "approximately" because, here in the Seattle area, most thermometers only go up to 55 or so.

 

Even crazier, the sky was no longer its familiar, comforting shade of ashen gray: instead, the sky was blue! (Yes, now that you mention it, the author of today's haiku should have taken a picture of that.) Yesterday afternoon, there was no doubt a mad scramble in elementary schools throughout the region as thousands of schoolchildren searched frantically for the Sky Blue crayons that have gone unused throughout the school year.

 

Note. And what about the children who couldn't find their Sky Blue crayon? No problem: there are plenty of other blue crayons to choose from, including Midnight Blue; Turquoise Blue; Violet Blue; Cadet Blue; Navy Blue; Ultra Blue; Robin's Egg Blue; Pacific Blue; and Wild Blue Yonder.

 

Unfortunately, though, none of the really cool colors – Inch Worm, Neon Carrot, Jazzberry Jam – come in shades of blue.

 

At any rate, things are back to normal today: the temperature is barely above 50, and the sky is a reassuring shade of gray. (You think it looks more Manatee than gray? Hmmm, maybe ….) At any rate, it's great to be rid of all that nice weather and back to the dismal existence we all know and love.

 

Anyway, on these gloomy gray days – what's that? Wisteria? No, Wisteria's really more of a purple than a gray. Anyway, as we were saying, on these gloomy gray days we Seattleites like to curl up in front of a warm fire, sip a cup of hot chocolate, and run Lync Server PowerShell cmdlets. Which cmdlet do we like to run? Why, Get-CsNetworkInterface, of course.

 

As if you even had to ask.

 

The Get-CsNetworkInterface cmdlet has only one job: it returns information about the network interfaces assigned to computers running Lync Server services or server roles. Called without any parameters, the cmdlet returns information like this for all of your Lync Server computers:

 

Identity : atl-cs-001.litwareinc.com/Primary/1

ComputerFqdn : atl-cs-001.litwareinc.com

IPAddress : 192.168.1.1

Interface : Primary

InterfaceNumber : 1

ConfiguredFqdn :

ConfiguredIPAddress :

 

As you can see, the Identity property looks a bit daunting at first: atl-cs-001.litwareinc.com/Primary/1? As it turns out, however, there's definitely method to the madness; in fact, the Identity is composed of three parts:

 

· The fully qualified domain name of the computer (for example, atl-cs-001.litwareinc.com). This is the same thing as the ComputerFqdn property.

· The network interface side, which indicates the type of network traffic that flows through the interface. The interface side will typically be one of the following: Primary; Internal; External; or PSTN. This is the same thing as the Interface property

· The network interface number for the specified side (for example, 1). The interface number is the same thing as the, well, as the InterfaceNumber property.

 

See? No big deal after all.

 

Note. Why do we need to specify the interface side and the interface number? You got it: because any one computer might have multiple network interfaces.

 

But calling Get-CsNetworkInterface without any additional parameters isn't much fun; let's see what else we can do with this cmdlet. For example, suppose we'd like a list of all the External interfaces. How do we get a list like that? Here's one way:

 

Get-CsNetworkInterface | Where-Object {$_.Interface –eq "External"}

 

Or maybe we'd like to see all the interfaces except for the Primary interfaces. No problem:

 

Get-CsNetworkInterface | Where-Object {$_.Interface –ne "Primary"}

 

Here's a cool one: how about all the interfaces that have an interface number other than 1? You know:

 

Get-CsNetworkInterface | Where-Object {$_.InterfaceNumber –ne 1}

 

Or how about this one: all the interfaces on the subnet 192.168.x.x:

 

Get-CsNetworkInterface | Where-Object {$_.IPAddress –match "^192.168."}

 

This is so much fun we wish it would rain every day!

 

Note. Oh, right. Guess it already does, doesn't it?

 

If you want to get back all the network interfaces for one particular computer you can use the ComputerFqdn parameter:

 

Get-CsNetworkInterface –ComputerFqdn "atl-cs-001.litwareinc.com"

 

Or what about all the computers in the Redmond area? Well, if you use the right sort of naming convention (for example, all your Redmond servers have the string value redmond somewhere in their name) you could use a command like this one:

 

Get-CsNetworkInterface –Filter "*redmond*"

 

Etc., etc.

That's pretty much all there is to the Get-CsNetworkInterface cmdlet. Like we said, it really only has one job to do, but it does that one job exceedingly well.

 

Note. What's that? Like the author of today's haiku does his job? Uh, we'll have to get back to you on that. Right now we have to go sit outside and try to get rid of whatever pale imitation of a tan we might have accidentally gotten yesterday. Thank goodness a day like that will never happen again!