Tips and Tricks

,

There are quite a few shortcuts and tricks that can be used within the Lync Server Management Shell to save time. This section discusses a few tips that might make using the Management Shell a bit easier and more efficient.

Use the Tab Key

Instead of typing a full cmdlet name, begin typing the first few letters after the action verb and press the Tab key. The Management Shell automatically cycles through the cmdlets that match the string already entered. For example, typing Get-CsP and then pressing Tab automatically changes to Get-CsPinPolicy. Pressing Tab again changes to Get-CsPool. Use Tab to go forward through the list and press Shift+Tab to cycle backward. The Tab key can also auto-complete parameters inside the cmdlet, so it is handy when recalling the exact parameter name.

Skip the Identity

Although the identity can make retrieving an object specific and is a required parameter when changing an object, it’s not required to type the entire identity parameter. If the identity is not explicitly referenced, the first string after the cmdlet is assumed to the identity. For example, the following two commands are equivalent in functionality, but one requires fewer characters:

Get-CsVoicePolicy –Identity Executives
Get-CsVoicePolicy Executives

Surround Spaces with Quotation Marks

When referencing objects or names that have spaces or special characters, make sure the entire text string is enclosed in quotation marks or single quotation marks. When PowerShell detects a space, it assumes the next character will be the beginning of a new parameter. Without surrounding the text string in quotation marks, it might lead to commands that fail. Both single and double quotation marks are acceptable. For example, when trying to retrieve the user Tom Pacyk, this command generates an error:

Get-CsUser Tom Pacyk

To successfully return the correct user, use the following command:

Get-CsUser "Tom Pacyk"

Leverage Get-Help

Included within all the Lync Server Management Shell cmdlets is a built-in help reference. To retrieve assistance with any cmdlet, simply type Get-Help followed by the name of the cmdlet. For example, to get assistance with the Set-CsDialPlan cmdlet, type

Get-Help Set-CsDialPlan

This help request returns a description of the cmdlet’s purpose, the full syntax and parameters available in the cmdlet, and a summary of what the cmdlet does. More information can also be requested using the –Examples, -Detailed, and –Full flags at the end of the command. –Examples returns sample commands with the correct syntax, -Detailed returns a description of each parameter, and –Full returns the complete documentation available.

Having this help reference available without manually searching through documentation is incredibly useful. It can also come in handy when you’re having trouble remembering a specific cmdlet name. In these cases, wildcards can be used to search through the documentation for a match. For example, the following command returns a list that displays Set-CsBandwidthPolicyServiceConfiguration and Set-CsBlockedDomain:

Get-Help Set-CsB*

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

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