The TechReady 12 Q and A

Several weeks ago your two favorite Lync Server PowerShell writers – no, not those guys; we meant us, you know, your two favorite Lync Server PowerShell writers. Remember?

OK, fine. Several weeks ago our two favorite Lync Server PowerShell writers presented an instructor-led lab at Microsoft TechReady 12, the "… semi-annual internal technical conference for Microsoft employees."

Note. Thank you; it is quite an honor, isn't it? Actually, we had our choice of presenting an instructor-led lab at TechReady or doing the halftime show at this year's Super Bowl. But seeing as how the Black Eyed Peas know absolutely nothing about Lync Server PowerShell (sorry Will.i.am, but it's true) we decided we should do TechReady.

During the lab we were asked a number of questions about Windows PowerShell in general, and Lync Server 2010 PowerShell in particular, and we thought some of you might find it useful if we recapped those questions and the answers we gave. Discarding the question we were asked the most ("Hey, where are the Black Eyed Peas?") here's the list of questions, a quick answer to each question, and a link to a more detailed explanation of each answer:

General PowerShell Questions

· Does the New-Alias cmdlet only allow you to create aliases for cmdlets themselves? Can you create an alias that actually covers several commands?

Quick Answer: New-Alias can only create aliases for cmdlets, file names, functions, scripts, and executable files. Your best bet? Create a function that runs multiple commands.

· Can you use the Format-Table cmdlet instead of the Select-Object cmdlet?

Quick Answer: If you're just displaying data onscreen yes. But in other cases, no.

· When you use the Select-Object cmdlet, how come PowerShell doesn't tell you that you asked for a property that doesn't exist?

Quick Answer: To be honest, we don't know. But we do know how to verify that a property is a valid property.

Lync Server User Account Questions

· Does the Active Directory object for a user have to exist before you can enable that user for Lync Server?

Quick Answer: Yes, it does. Lync Server's Enable-CsUser cmdlet won't create an Active Directory account for you. But we do have a potential workaround for that.

· Aren’t the Filter parameter and the Enabled attribute on the Get-CsUser cmdlet redundant? Doesn't Get-CsUser always return all the users who have been enabled for Lync Server?

Quick Answer: Actually, it depends on what your definition of Enabled is.

· With Get-CsUser and Get-CsAdUser, doesn’t the Where-Object cmdlet do the same thing as the Filter and LdapFilter parameters?

Quick Answer: Often-times, yes. But it does the same thing in a very different way.

· Can Set-CsUser construct a SIP address for you?

Quick Answer: No. But we found a tricky way to work around this.

· Does Lync Server use the same Active Directory attributes and attribute values that Office Communications Server 2007 R2 used?

Quick Answer: Kind of sort of. But you're better off not directly modifying Active Directory attributes.

· How come I can't use the Active Directory Name attribute as an Identity? Exchange lets you use the Name.

Quick Answer: For better or worse, you just can't. But there's a way to work around that issue, too.

· How come there isn't a warning prompt that appears when you run Disable-CsUser? It seems like a kind of dangerous cmdlet to not have a warning.

Quick Answer: We don't really know. But we have some suggested ways to work around that problem.

Lync Server Policy Questions

· Is there any way to copy a Lync Server policy?

Quick Answer: No. Well, unless you try our unsupported, unofficial workaround.

· Where are policy defaults stored? Are they inherited from the global policy? Can I change the default values?

Quick Answer: Policy defaults are built into Lync Server, and are not inherited from the global policies.

· What's the different between the Grant-Cs cmdlets and the Set-Cs cmdlets? Are there any Grant-Cs cmdlets that don't deal with policies?

Quick Answer: The Set-Cs cmdlets modify policies; the Grant-Cs cmdlets assign policies. Usually.

· How can I retrieve all the global policies?

Quick Answer: There is no simple way to do this. But we did find a sort of simple way to do it.

Other Lync Server PowerShell Questions

· Are Lync Server sites related to Active Directory sites? How can I get a list of my Lync Server sites? And how do I create a site policy?

Quick Answer: Lync Server sites have nothing to do with Active Directory sites.

· How can I set the actual number that calls are forwarded to?

Quick Answer: You can't. Sorry.

And what if you have a question that isn't on this list? That's fine; just send us an email and we'll do our best to answer it for you.

But sorry, we don't have any idea whether or not the Black Eyed Peas will be coming to your hometown any time in the near future. You might check their Web site and see if that helps.