Bulk-Uploads of Lync Phone Edition Updates

For environments with only a few Front-End pools applying device updates is a fairly simple process. You run the Import-CsDeviceUpdate cmdlet a few times to cover each phone vendor and you're done, but I've found that once you have a number of pools to update this process becomes incredibly tedious. In order to expedite this I've created a simple little PowerShell script which will search the environment for all Front-End pools and upload all the .cab files to each FE.

You can copy this text and save it as a .ps1 file on your Lync server.

Get-CsService -WebServer | Select PoolFQDN | ForEach {
	Import-CsDeviceUpdate -Identity ('WebServer:' + $_.PoolFQDN) -FileName Aastra.cab
	Import-CsDeviceUpdate -Identity ('WebServer:' + $_.PoolFQDN) -FileName HP.cab
	Import-CsDeviceUpdate -Identity ('WebServer:' + $_.PoolFQDN) -FileName Polycom.cab
	Import-CsDeviceUpdate -Identity ('WebServer:' + $_.PoolFQDN) -FileName Tanjay.cab

The only actions required from the admin are:

  1. Download each of the Lync Phone Edition packages.
  2. Extract each UCUpdates.cab files to a single common folder. Rename them as follows: Aastra.cab, HP.cab, Polycom.cab, Tanjay.cab
  3. Open the Lync Management Shell, and CD into the folder where the .cab files were extracted.
  4. Launch the script.

    Monitoring OCS and Lync Peak Call Capacity

    Recently I had a customer interested in checking how many concurrent calls a particular OCS Mediation Server was handling. The challenge with this is that separate perfmon counters exist for inbound calls and for outbound calls, but there is not a built-in counter which measures both. So while we could monitor the peak capacity of each we had no guarantee that these peak values were occurring at the same time.

    In order to track this usage I've come up with a Powershell script which grabs these two counters, parses their values, adds them together, and dumps the output into a CSV file. At the end of the monitoring period you can take this CSV into Excel and easily find the peak total call count.

    Here are some notes on the behavior:

    • The CSV output is date and time, inbound calls, outbound calls, and total calls.
    • Data is output to the console and to CSV for real-time monitoring.
    • The default values track usage for a week, polling the counters every 15 seconds. You can change the total number of loops in the script to your liking if you need a longer track record.
    • If you run the script again it will detect if previous data exists and rename the old file so you don't lose anything.
    • I've run this as a logged in user account, but I imagine you could set it up as a scheduled task to run in the background.
    • In order to run the script you should first run Set-ExecutionPolicy Unrestricted

    The caveat with the Lync version is now that a Mediation server can use multiple gateways we can't see which gateway is being used for each inbound or outbound call. But this still gives an idea of concurrent call capacity flowing through each Mediation role.

    I hope to improve this in the future, but wanted to make it available for everyone sooner than later.