Last week was another one of those weeks when it came to the Lync Server PowerShell One of These Things is Not Like the Others challenge; that is, one of those weeks when the answer was far from obvious. Remember the good old days, when the challenge would ask you to pick out the outlier from a set of cmdlets like, say, these four:
· New-CsVoicePolicy
· New-CsExternalAccessPolicy
· New-CsClientPolicy
· Test-CsIm
Well, last week wasn't quite that easy. Instead, we asked you to pick out the outlier from this set of cmdlets:
Set-CsManagementConnection |
Get-CsUICulture |
Test-CsComputer |
Set-CsMediationServer |
Not quite as easy, to say the least.
But definitely not impossible. (At least in part because we'll actually allow you to pick any of the four cmdlets, as long as you can come up with a good reason as to why that cmdlet is not like the others.) For last week's challenge, those of us here at the Lync Server PowerShell blog decided that Set-CsMediationServer was the oddball cmdlet. Why? Because it's the only one of the four cmdlets that can be run remotely; the other three cmdlets all have to be run on the local computer. Set-CsManagementConnection and Get-CsUICulture deal with management settings on the local computer; because of that, it would make no sense to allow them to be run remotely. In theory, Test-CsComputer – which verifies the status of any Lync Server services running on the local machine, and also checks to be sure all the correct firewall ports have been opened on the local computer – could be run remotely. However, that capability was never added to the cmdlet. As a result, Test-CsComputer is local-only.
If you're skeptical, here's how you can verify this. Start up a remote session of Lync Server PowerShell. (Make sure you run this session under the credentials of someone who happens to be a full-fledged Lync Server administrator.) When the session starts and the Lync Server cmdlets have all been imported, try running these commands:
Get-Command Set-CsManagementConnection
Get-Command Get-CsUICulture
Get-Command Test-CsComputer
Get-Command Set-CsMediationServer
The first three commands should all fail to return any information. Why? Because the three cmdlets in question can only be run locally. Among other things, that means that they will not be downloaded when you start up a remote session for Lync Server PowerShell. After all, there's no point to downloading those cmdlets: like we said, you can't run them in a remote session.
Give it a try and see for yourself.
Aleksandr N. and Matt S. both noted this very thing. As Matt pointed out, Set-CsMediationServer is "… the only command that is not a local command. That is, all the other commands return/test/change local computer/shell settings and information. Set-CsMediationServer makes changes at the CMS level, which are then pushed down to the Mediation servers."
He's absolutely right.
On the other hand, other people did make good cases for some of the other cmdlets. Ramkumar R. also opted for Set-MediationServer, but for a different reason: because it's the only one of the four cmdlets to have an Identity parameter. (Which, to be honest, we completely overlooked.) Tom A. settled on Set-CsManagementConnection because it was the only cmdlet that had any required parameters. (Which, alas, we also completely overlooked.)
As usual, thanks to everyone who played along last week. Do we have another challenge waiting for you this week? Hey, do you even have to ask?