Script to find current Cumulative Updates on Lync servers in a deployment

adhesive_bandage-512Recently I posted a blogpost on Finding the correct patch version of a Lync server. After writing the blogpost I realized that it would be very cool to automate this using PowerShell. The result is Get-CsInstalledLyncVersion.ps1 which is available to TechNet Gallery. This is a great tool to do an initial assesment of a Lync deployment where you get a good overview of installed servers and their current patch level.

Get-InstalledLyncVersion.ps1 script to check patch level on all Lync servers in an environment

  • .Notes
    • This script works for Lync Server 2010 and Lync Server 2013
    • Run Lync Management Shell in Administrative mode
    • Use the Function Get-RemoteProgram by Jaap Brasser, modified by MVP Jan Egil Ring
    • If you can not connect to a server make sure Remote Registry Service is running on the machine you are unable to reach
      • Port 139 and 445 needs to be open on the server you are trying to scan
    • Tested OK in 2010 and 2013 environments
    • The script will be updated as new CU’s will arrive, but will also flag unknown CU versions and let you download the latest one
  •  V1.0 May 2014 – Initial Script
    • Scans registry on all servers in a Lync deployment to find current installed version
    • You shall not use WMI to query MSI packets as that will invoke a reconfiguraton
    • Checks against a database in this script to find the correct CU level
    • Will ask if you want to download the current CU if there are servers which is not on the latest patch level
      • Using function New-FileDownload by MVP Pat Richard
      • Will open the download location after the file is downloaded
    • No Parameters are required

Download the script here

Pat Richard beat me to it and released a similar script days before I completed mine. Check it out at http://www.ehloworld.com/2641

Screenshots:

Output of scanned computers in a 2010 environment

Get-InstalledLyncVersionV1

Output of CU download dialogue in 2013 environment

Get-InstalledLyncVersionV2

13 thoughts on “Script to find current Cumulative Updates on Lync servers in a deployment

  1. Hi Stale, great script, thanks for this. I found one issue, as the script also detects Trunks as Computers in the Get-CsPool cmdlet and therefore issues an error because the trunks can´t be found to connect to.

    • Thanks for testing, I thought I hade mitigated that problem. Need to retest then and make sure it will remove the PSTN gateways. Do you get an error message or just that it is unable to connect to it?

      • Here´s a part of the error message, I can send you the complete output directly if needed.

        Get-CsComputer : Cannot find “Computer” “FO-AC01–RGBLYNC02” because it does not exist.
        At D:\Scripts\Get-CsInstalledLyncVersion.ps1:140 char:30
        + if ((Get-CsPool (Get-CsComputer $Line.ComputerName | Select-Object – …
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo : ResourceUnavailable: (fo-ac01–rgblync02:String) [Get-CsComputer], KeyNotFoundException
        + FullyQualifiedErrorId : MissingItem,Microsoft.Rtc.Management.Xds.GetComputerCmdlet

        Get-CsPool : Cannot validate argument on parameter ‘Identity’. The argument is null or empty. Supply an argument that is not null or empty and then
        try the command again.
        At D:\Scripts\Get-CsInstalledLyncVersion.ps1:140 char:29
        + if ((Get-CsPool (Get-CsComputer $Line.ComputerName | Select-Object – …
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo : InvalidData: (:) [Get-CsPool], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Rtc.Management.Xds.GetPoolCmdlet

  2. Hi Stale, thanks for the script. It’s nice to get an overview about the updates to see if the deployments is up to date. I have a question about this script. Is it possible to integrate an export command to get a nice list that you can import in Excel. Keep up the good work. Thanks

    • Hey Marcel. Thanks for taking time to use the script and give feedback. Ofcourse I can export the list to file. Are you really sure you want it in excel though? not sure if the formatting will be optimal. Maybe you want it as grid view instead? I will add your request to the feature request pool for my next update :)

  3. I love this script, use it all the time. Thank you!

    I too would love to see it with an ability to export to csv or excel format, especially if performing a health check and you want to just quickly capture the CU level of all servers in an environment.

    • I asked one of my PowerShell guru coworkers to update the script to include the export to csv. He got it done and works great. If you want it let me know where to email the updated script.

    • Thanks, can you post the version number that is found? its all about having the correct CU versions updated in the script. I am suspecting you have a newer CU than is in the table in the script :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s