,

PowerShell

For Lync, Microsoft has changed the way that Lync is administered. There is a new browser-based management interface called the Lync Server Control Panel (LCSP) that you can use for all your administration tasks. If you are an administrator type that prefers a command line–type interface, there is something for you, too. Microsoft has also included the Lync Server Management Shell. Both these administration tools have one big thing in common: They both run on PowerShell. This means that anything you can do from the browser-based LSCP, you can do from the command prompt.

There are more than 500 new Lync PowerShell cmdlets to enable users for Lync, set up SIP domains, set up routing, and a host of other tasks.


Tip

Although it might seem daunting to figure out which Lync cmdlet to use, it isn’t that difficult. Microsoft has created an excellent blog at http://blogs.technet.com/b/csps/ to introduce you to Lync PowerShell programming. It even has a blog post on UI mapping that shows the relationship between the LSCP and the Lync Management Shell so that you know which Lync cmdlet to use and how the cmdlet parameters relate to the fields you see in the browser. We won’t try to duplicate that here, but we show how you can get help to determine which cmdlet you need.


Let’s start with the basics. To get started, go to the Windows Start menu, expand the Microsoft Lync Server 2010 menu item, and then click Lync Server management Shell. This starts a PowerShell session and loads the Lync Server module.

Now that you have the management shell running, let’s make the assumption that you want to do something with a user such as enable a user for Lync. Well, how do you go about finding which cmdlet to use? You can use the Get-Command to get a list of Lync-related commands by typing the following command:

Get-Command *CS* | More

This command gives some extraneous information, but it includes all the Lync cmdlets and you will see that they follow the normal PowerShell methodology of verb-noun. Quickly skimming through the list, notice some cmdlets with CsUser in the name columns so that you can modify your command to look for just the user-related cmdlets. Figure 21.1 shows the results of running the command looking for CsUser-related cmdlets.

Figure 21.1 Results of Running Get-Command *CS*

image

Notice that we now have a list of the Lync cmdlets that deal with Lync users, and you can quickly determine that Enable-CsUser is probably the one that you need. But, to be sure, you can use the Get-Help to check that assumption. Figure 21.2 shows the results of that command.

Figure 21.2 Using the Get-Help Command

image

We now have all the information we need to enable a user for Lync. The following command enables the user for Lync:

Enable-CsUser –Identity "[email protected]" –RegistrarPool
"Lyncfe2.companyabc.com" –SipAddress "sip:[email protected]"

As you can see, you need to tell the cmdlet what user to enable, which pool to register the user with, and what the SIP address of the user will be. That is all there is to it. If you were to look at the users in the Lync Server Control Panel, you would see that the user is now enabled for Lync.


Tip

There are more steps, such as enabling the user for enterprise voice (Set-CsUser) and setting up the user for voicemail (Set-CsUser again), but you get the idea. As mentioned previously, the Lync PowerShell blog on Microsoft TechNet is an excellent start for learning more about administering Lync using the PowerShell command-line interface.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset