Top 5 New Lync 2013 PowerShell Features

Microsoft Lync Server 2013 ships with Microsoft PowerShell Version 3.0 which has many improvements to the PowerShell command line interface. Coupled with new additions in the Microsoft Lync PowerShell module, the two bring a lot of great new things to the Lync Administration table. This blog post contains the top 5 things I have discovered so far.

1] The Show-Command CmdLet

The new PowerShell V3 Show-Command cmdlet bridges a bit of the gap between a CLI and GUI interface – which eases some of the syntax-challenges with a CLI interface.

Running this cmdlet opens a small user interface with a list of all available PowerShell modules in your PowerShell session and a full listing of all of the cmdlet’s, aliases, drives, and functions available in those modules.

Even if you are comfortable with the command line, the new Show-Command cmdlet can help you:

Easily discover and explore what cmdlet’s are available and what module they reside it (see the Tip below)

Easily see what parameters need to be entered to run the cmdlet

Tip – You can quickly filter on the cmdlet’s available in a particular PowerShell Module by using the Modules drop-down. Here is a screen shot with the filter applied to the Lync PowerShell module. This shows all the Lync Server 2013 cmdlets that are available.

Hmm…notice the new LyncOnlineConnector module.

Any available cmdlet can be selected (or type its name in Name textbox), and the GUI presents a bottom panel with the parameters for that cmdlet. Below is a screen shot of the Get-CsUser cmdlet. The parameters can be supplied in the GUI and it can be run directly from the GUI – which in-turn runs the cmdlet on the command line.

2] Easily Return the Lync Policies Assigned to a User

There is a new Lync Server 2013 PowerShell cmdlet called Get-CsEffectivePolicy that returns all the Lync policy assignments for a Lync user – regardless of whether the policy is a user policy, a service policy, a site policy, or the global policy. This simplifies user account management and reporting compared to Lync Server 2010.

In Lync Server 2010 the only cmdlet available to see which Lync policies have been assigned to a particular user was the Get-CsUser cmdlet – and this cmdlet only returns any user level policies; any assigned global, service, or site policies will not be shown (just a blank value beside the policy property). Instead, a non-trivial Lync Powershell script was required to return all of the policy assignments for a user as documented here: http://blogs.technet.com/b/csps/archive/2010/06/07/scriptuserpolicyassignments.aspx.

Here is an example of how the Lync Server 2013 Get-CsEffectivePolicy simplifies life.

3] New Features and Enhancements to the PowerShell ISE

PowerShell V3 ships with the Windows PowerShell 3.0 Integrated Scripting Environment (ISE). While it lacks some advanced features of more mature 3rd-party PowerShell development environments used for heavy script development, it does have some nice enhancements and feature additions which makes it a lot better for Lync Administration.

IntelliSense and Context Sensitive Syntax Help

PowerShell by nature is a syntax-heavy language. Providing IntelliSense (type-ahead possibilities) and pop-up syntax references is a big help.

This is available in both the PowerShell ISE IDE and the ISE console window:

This is also particularly useful for interrogating variables such as the environment variable as shown here:

In-Place Updating of Windows PowerShell Help

Directly from the PowerShell ISE you can update the help (select Help | Update Windows PowerShell help). This will update the content for all the cmdlet’s in the loaded modules:

Microsoft Powershell MVP Shay Levy has some great pointers about the updatable help system in this post: Improving the output of Update-Help such as you must be running as an Administrator in order to update the help.

There is a lot of potential here for Lync Administration. For example, if you have a Lync administration script that returns a list of Lync users and their properties, you could extend the PowerShell ISE to query the policy settings of a Lync policy assigned to a user that you have highlighted in the output.

5 new cmdlet’s which allow management of the new Lync 2013 meeting room functionality

XMPP

> Get-Command “*CsXmpp*” -CommandType Cmdlet

New cmdlet’s allow administrators to manage the new built-in XMPP gateway.

Test Cmdlets

The new cmdlet names are too varied to easily enumerate them, but some of the more notable new test cmdlet’s are:
> Test-CsUnifiedContactStore
> Test-CsExUMConnectivity
> Test-CsAVEdgeConnectivity
> Test-CsDatabase
> Test-CsDataConference

For a complete listing of all test cmdlet’s:
> Get-Command “Test-Cs*” -CommandType Cmdlet

There are ~15 new test cmdlet’s which allow verification that specific Lync functionality is working.

The FIPS standards are a set of US government security standards required for use in computers maintained by non-military government agencies and by government contractors – these new cmdlet’s manage these settings.

Miscellaneous Cmdlets

There are ~15 other new Lync cmdlet’s which help manage a collection of various Lync system settings.

During my Lync Server 2013 travels, I have not found many Lync specific cmdlet’s that have changed behavior.

Several cmdlet’s return more properties – usually reflecting the new Lync 2013 features. For example, the well used Get-CsUser cmdlet returns 64 Lync user properties, whereas Lync 2010 returned 56. Here are some of the new Lync user properties:

ExchangeArchivingPolicy

UserRoutingGroupId

VoiceRoutingPolicy

LegalInterceptPolicy

PersistentChatPolicy

UserServicesPolicy

ExperiencePolicy

HostingProvider

The Get-CsConfigurationStoreLocation cmdlet now returns 2 properties BackEndServer & MirrorBackEndServer to reflect the high availability and backup and recovery features of Lync 2013, whereas in Lync 2010 this cmdlet just returned one string with the SQL Server path to the computer running the CMS.

5] The Windows PowerShell Web Access feature

PowerShell V3 boasts another useful Administration feature – the ability to host a PowerShell session within a web browser. The PowerShell console is hosted on an IIS web site and provides a basic text console where you can run PowerShell cmdlet’s. The console will connect to the remote computer that you specified during the sign-in process (in this case a Lync 2013 server).

This opens the door for doing basic Lync Administration from a web browser, which would be really useful on a device or computer that has a web browser available but is not running Windows – such as your favorite tablet smartphone if it has network access to the IIS web site.

This is available in Windows Server 2012, but not Windows 2008 or Windows 2008 R2, and Windows Server 2012 does not have the Windows PowerShell Web Access feature enabled by default, so you first need to enable the feature using the new Server Manager.

Tip – making this feature work requires several non-trivial configuration steps in addition to installing the PowerShell Web Access (including assigning a certificate, etc…). Nevertheless, it can be a useful Administration feature if you need it.

Legal

The posts and information on this blog are provided "as is" with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer or anyone else for that matter. All trademarks acknowledged. Copyright 2013 Curtis Johnstone.