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.
The Get-CsUser cmdlet’s returns the following 15 Lync policy assignments for user “Curtis Johnstone”:
> Get-CsUser “curtis johnstone”
ExternalAccessPolicy : User Policy
But the Get-CsEffectivePolicy returns all the policy assignments for the Lync user – regardless of whether they are user, site, service, or global policies as shown here:
> Get-CsEffectivePolicy “curtis johnstone”
Identity : curtis johnstone
ConferencingPolicy : Global
PresencePolicy : Global
LocationPolicy : Global
VoicePolicy : Tag:International All
LocationProfile : Global
ClientVersionPolicy : Global
ClientPolicy : Global
ImArchivingPolicy : Global
UserPinPolicy : Global
ExternalAccessPolicy : Tag:User Policy
HostedVoicemailPolicy : Global
MobilityPolicy : Global
PersistentChatPolicy : Global
VoiceRoutingPolicy : Global
UserServicesPolicy : Global
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.
Windows PowerShell ISE Add-On Tools
The PowerShell ISE has the ability to be extended with ISE Add-On’s. An Add-On is a piece of PowerShell code which extends the functionality of PowerShell ISE – for example, you can add the ability to do a spellcheck or create an html version of the current script for printing or add custom menu entries that carry-out an action.
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.
See the Microsoft TechNet Windows PowerShell ISE Add-On Tools website to get started.
4] New & Changed Lync PowerShell CmdLets
New Lync Cmdlets
There are 173 new Lync specific cmdlet’s added in Lync Server 2013 PowerShell module (567 Lync Server 2010 versus 740 in Lync Server 2013). Rather than list all the new cmdlet’s here I will summarize the new cmdlet’s associated with the new Lync 2013 functionality (if you do want a full listing fellow Lync MVP Tom Arbuthnot did a nice job of this on his blog during the Lync 2013 Preview Release).
|New Lync 2013 Functionality||To See all of the Related Cmdlet’s||Description|
|Persistent Chat||> Get-Command *CsPersistent* -CommandType Cmdlet||Complete management of Persistent Chat configuration, rooms, users, and policies.|
|User Services||> Get-Command *CsUserServicesPolicy* -CommandType Cmdlet||5 new cmdlet’s are used to manage whether user contacts are stored in Lync or the new Unified Contact Store (UCS).|
|Centralized Logging||> Get-Command *CsCls* -CommandType Cmdlet
> Get-Command *CsCentralizedLogging* -CommandType Cmdlet
|Complete management of the new Lync centralized server logging. Get-CsClsConfiguration will return details about the current configuration.|
|Pool Pairing||The cmdlet names are too varied to easily enumerate them but a good starting point is available on Microsoft TechNet: Lync 2013 Backup and High Availability Cmdlets||New cmdlet’s allow administrators to view and manage Lync 2013 pool pairing.|
|Meeting Rooms||> Get-Command *CsMeetingRoom* -CommandType Cmdlet||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:
For a complete listing of all test cmdlet’s:
|There are ~15 new test cmdlet’s which allow verification that specific Lync functionality is working.|
|Outbound Number Translation||> Get-Command “*CsOutboundCallingNumberTranslationRule*” -CommandType Cmdlet||New cmdlet’s to manage the new outbound calling number formatting capabilities in Lync 2013|
|Reporting Configuration||> Get-Command “*CsReportingConfiguration* -CommandType Cmdlet||New cmdlet’s to manage the native monitoring reports.|
|Partner Application||> Get-Command “*CsPartnerApplication*” -CommandType Cmdlet||Partner applications are used for Lync features which integrate with Lync 2013. There are 4 new cmdlet’s that can be used to configure and view these settings.|
|Presence Provider||> Get-Command “*CsPresenceProvider*” -CommandType Cmdlet||4 new cmdlet’s to manage Presence Providers (a collection of users services configuration).|
|Watcher Node Configuration||> Get-Command “*CsWatcherNodeConfiguration*” -CommandType Cmdlet||4 new cmdlet’s to manage integration with Microsoft SCOM.|
|Federal Information Processing Standards (FIPS)||> Get-Command “*CsFIPS*” -CommandType Cmdlet||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.
Notable new cmdlet’s:
Lync Cmdlet’s that have Changed from Lync 2010
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:
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.
There are some limitations compared with the regular Windows PowerShell console which are outlined here: http://technet.microsoft.com/en-us/library/hh831417.aspx#BKMK_web.
Here are some good references to get you started: