Home > Lync Server > Script: Get-CsUpdateVersion.ps1 – See the Cumulative Update Level Of All Lync Servers

Script: Get-CsUpdateVersion.ps1 – See the Cumulative Update Level Of All Lync Servers

Description

My work at Modality Systems often has me doing health checks for customer Lync environments. These can be due to customer requests, or as part of our onboarding for new managed support customers. If you’ve ever had an Active Directory Risk Assessment Program (ADRAP) or Exchange Risk Assessment Program (ExRAP), it’s quite similar. Lots of tasks to run, lots of data to sift through. So it’s always beneficial to standardize and automate the steps to get the data. The same is the case when you’re responsible for your own environment and want to ensure good health.

Just like Get-CsDatabaseUpdateStatus.ps1, Dave Howe from the Lync product group and I teamed up to automate something. In this case, it’s looking at what Cumulative Updates are installed on each server throughout a Lync environment. This script queries each pool, then finds what servers are part of that pool, and queries each server to find the CU that’s installed. It then provides an easy to read output of the entire environment (with exceptions) for easy review. As shown below, we see three multi-server pools, the version number and “friendly” Cumulative Update info.

Get-CsUpdateVersion3

The script works fine with Standard Edition servers as well:

Get-CsUpdateVersion4

In the first example, you see that the first two servers show “PSRemoting failure”. This is because the script uses PowerShell Remoting to connect to each remote server to query information (see installation notes below). PSRemoting doesn’t really work the same when dealing with non-domain joined machines, such as the first two, which are edge servers. So the script isn’t able to communicate with them via PSRemoting, and flags them. If the script can’t ping a server, it will show as “offline”. The friendly name of the CU shown is coded in the script. So I’ll update it each time a new CU is released.

By default, the script checks all pools. But you can specify a single pool by using the -PoolFqdn parameter.

Syntax

Get-CsUpdateVersion.ps1 [[-PoolFqdn] ] [-WhatIf] [-Confirm] []

Installation

This script uses PowerShell Remoting to query remote servers. PSRemoting is enabled by default on Windows Server 2012 and later, but disabled by default on 2008 R2. To enable PSRemoting on 2008 R2 servers, see Enable-PSRemoting.

Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.

Assumptions

None

Download

v1.4 – 09-24-2014 – Get-CsUpdateVersion.v1.4.zip

v1.3 – 09-02-2014 – Get-CsUpdateVersion.v1.3.zip

v1.2 – 08-07-2014 – Get-CsUpdateVersion.v1.2,zip

v1.1 – 06-02-2014 – Get-CsUpdateVersion.v1.1.zip

v1.0 – 05-02-2014 – Get-CsUpdateVersion.v1.0.zip

Changelog

See the changelog for information on what’s changed/included in each version.

  1. May 6, 2014 at 9:12 am | #1

    Thx Pat for your effort, it was a good solution

  2. May 7, 2014 at 3:42 am | #2

    Fantastic as always Pat. Thanks a ton.

  3. davidchr
    May 16, 2014 at 11:17 am | #4

    Another great tool for Lync admins! Im seeing an issue though…all of my servers in the edge pool are showing the following: fqdn of server (offline)
    I checked execution policy and its remotesigned. The Edge server’s OS is 2012 and they are in the DMZ. We used the following http://technet.microsoft.com/en-us/library/gg398739.aspx to open the necessary ports to/from the edge servers and between edge and fe boxes. Any ideas?

    • Pat Richard
      May 16, 2014 at 10:58 pm | #5

      It’s not likely going to work with Edge servers, as their is no AD authentication to those machines.

  4. Andy G
    May 20, 2014 at 11:52 pm | #6

    If you have newer Debugging Tools or Resource Kit it detects those as the current version. Perhaps you should only look at the Core Components program as that should always reflect the latest installed version?

    • Pat Richard
      May 30, 2014 at 11:20 am | #7

      That’s being addressed in the new version, as is a quirk around Lync Server 2010.

  5. Mickael B
    August 13, 2014 at 9:43 am | #8

    Great script !
    For the 2013 Edge server, you could use the output of “Get-CsManagementStoreReplicationStatus” to get the “ProductVersion”, which is not very elegant, but should do the trick (at least for 2013)

    • Pat Richard
      August 16, 2014 at 1:39 am | #9

      The problem with that is it’s also not accurate. If you have post CU patches installed, Get-CsManagementStoreReplicationStatus just shows the version to the CU – not to any post CU patches.

      • Brian Longoria
        August 28, 2014 at 5:13 pm | #10

        Yep – that’s what led me here. Had all CU 5 updates, and repstatus was still returning .556- I got concerned why there was a difference. Still haven’t found why, but at least this script, plus server control panel\product version and the CU.exe. three confirmations makes me feel a lot more secure. Thanks for the script.

  1. May 3, 2014 at 11:55 pm | #1
  2. May 5, 2014 at 7:28 am | #2
  3. May 7, 2014 at 3:41 am | #3
  4. July 3, 2014 at 1:13 pm | #4

Leave a Reply