Archive

Posts Tagged ‘patching’

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

May 2nd, 2014 45 comments

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.

PS C:\> .\Get-CsUpdateVersion.ps1

ComputerName   : sjc-edge01
PoolFqdn       : sjc-edge01.contoso.com
Version        :
Product        :
Update         :
FriendlyResult : PSRemoting failure
UpToDate       :
UpdateUrl      :

ComputerName   : sjc-fe01
PoolFqdn       : sjc-fe01.contoso.com
Version        : 6.0.9319.272
Product        : Skype for Business Server 2015
Update         : CU4 - 11/04/2016
FriendlyResult : Skype for Business Server 2015 CU4 - 11/04/2016
UpToDate       : False
UpdateUrl      : http://support.microsoft.com/kb/3199093

ComputerName   : sjc-pc01
PoolFqdn       : sjc-pc01.contoso.com
Version        : 6.0.9319.272
Product        : Skype for Business Server 2015
Update         : CU4 - 11/04/2016
FriendlyResult : Skype for Business Server 2015 CU4 - 11/04/2016
UpToDate       : False
UpdateUrl      : http://support.microsoft.com/kb/3199093

The script works fine with Standard Edition servers as well.

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 online XML file that the script queries. 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. The script requires Internet access on the machine the script is running on. This is to query the XML file containing the update information.

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.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Assumptions

None

Download

v3.9 – 03-08-2017 – Get-CsUpdateVersion.v3.9.zip

v3.8 – 02-14-2017 – Get-CsUpdateVersion.v3.8.zip

v3.7 – 02-05-2017 – Get-CsUpdateVersion.v3.7.zip

v3.6 – 01-06-2017 – Get-CsUpdateVersion.v3.6.zip

v3.5 – 11-28-2016 – Get-CsUpdateVersion.v3.5.zip

v3.4 – 11-12-2016 – Get-CsUpdateVersion.v3.4.zip

v3.3 – 08-31-2016 – Get-CsUpdateVersion.v3.3.zip

v3.2 – 07-15-2016 – Get-CsUpdateVersion.v3.2.zip

v3.1 – 07-05-2016 – Get-CsUpdateVersion.v3.1.zip

v3.0 – 04-21-2016 – Get-CsUpdateVersion.v3.0.zip

v2.9 – 04-07-2016 – Get-CsUpdateVersion.v2.9.zip

v2.8 – 01-26-2016 – Get-CsUpdateVersion.v2.8.zip

v2.7 – 12-14-2015 – Get-CsUpdateVersion.v2.7.zip

v2.6 – 11-17-2015 – Get-CsUpdateVersion.v2.6.zip

v2.5 – 11-11-2015 – Get-CsUpdateVersion.v2.5.zip

v2.4 – 10-03-2015 – Get-CsUpdateVersion.v2.4.zip

v2.3 – 09-09-2015 – Get-CsUpdateVersion.v2.3.zip

v2.2 – 07-14-2015 – Get-CsUpdateVersion.v2.2.zip

v2.1 – 06-21-2015 – Get-CsUpdateVersion.v2.1.zip

v2.0 – 05-12-2015 – Get-CsUpdateVersion.v2.0.zip

v1.9 – 02-19-2015 – Get-CsUpdateVersion.v1.9.zip

v1.8 – 02-09-2015 – Get-CsUpdateVersion.v1.8.zip

v1.7 – 01-01-2015 – Get-CsUpdateVersion.v1.7.zip

v1.6 – 12-12-2014 – Get-CsUpdateVersion.v1.6.zip

v1.5 – 11-21-2014 – Get-CsUpdateVersion.v1.5.zip

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.

Changelog: Get-CsUpdateVersion.ps1

May 2nd, 2014 3 comments

This is the changelog page for Get-CsUpdateVersion.ps1. You will find a complete list of released versions, their dates, and the features and issues addressed in each. Please refer to the script’s main page for more information including download links, installation details, and more.

v3.9 – 03-08-2017

  1. Converted script to return PowerShell objects instead of the previously used write-host and write-output. While this sheds the nicely colored output, it makes it far more effective, and better aligns with PowerShell best practices.
  2. Converted the script to ONLY use the online data for version info. This means that every time a new update is released for Lync Server 2010, Lync Server 2013, and/or Skype for Business Server 2015, I don’t need to release a new version of the script – merely update the hosted XML file containing the data. This also means that users of the script won’t need to always download a new version. This doesn’t mean there will be no further updates to the script.
  3. Fixed an issue where when using the online data (available in the last couple of versions using the -online switch) doesn’t check the online data for each server (and due to a glitch, sometimes twice for each server). The data is retrieved once when the script starts.
  4. Added some more verbose output, as large environments or those with slower connections to remote servers, or those with unreachable servers would slow the script down. Running it with the -verbose option will at least give the user some running information.
  5. Some code cleanup and optimization.

v3.8 – 02-14-2017

  1. added version 6.0.9319.277 for Skype for Business Server

v3.7 – 02-05-2017

  1. Code cleanup/optimization
  2. added version 5.0.8308.984 for Lync Server 2013

v3.6 – 01-06-2017

  1. Added 5.0.8308.977 for Lync Server 2013

v3.5 – 11-28-2016

  1. Added 5.0.8308.974 for Lync Server 2013
  2. Fixed an issue with the Get-UpdateInfo function that was causing unexpected “PSRemoting Failure” errors later in the script.
  3. Added the -online option, which will query update information from an online source instead of the info within the script itself. If this pans out ok, it will be the default method in future versions. It does require that the machine running the script have Internet access.

v3.4 – 11-12-2016

  1. Added new update mechanism
  2. Added some logging
  3. Added 4.0.7577.728 for Lync Server 2010
  4. Added 6.0.9319.272 for Skype for Business Server 2015

v3.3 – 08-31-2016

  1. Added build 5.0.8308.965 for Lync Server 2013

v3.2 – 07-15-2016

  1. Added build 5.0.8308.956 for Lync Server 2013

v3.1 – 07-05-2016

  1. Added build 6.0.9319.259 for Skype for Business Server 2015

v3.0 – 04-21-2016

  1. Added build 4.0.7577.726 for Lync Server 2010
  2. Added build 5.0.8308.949 for Lync Server 2013

v2.9 – 04-07-2016

  1. Added build 6.0.9319.235 (03/18/2016) – Thanks to Geir Age Moretensen for pointing it out

v2.8 – 01-26-2016

  1. Added support for Lync Server 2013 build 5.0.8308.945 (01/03/2016) – Thanks to Geir for pointing it out

v2.7 – 12-14-2015

  1. Added support for Lync Server 2013 build 5.0.8308.941 (12-14-2015)

v2.6 – 11-17-2015

  1. Added support for Skype for Business Server 2015 build 6.0.9319.102 (11/17/2015).

v2.5 – 11-11-2015

  1. Added support for Skype for Business Server 2015 build 6.0.9319.88 (9/26/2015).
  2. Removed references to Skype for Business Server 2015 Cumulative Updates due to general confusion.

v2.4 – 10-03-2015

  1. Added support for Lync Server 2013 CU15 (5.0.8308.927)
  2. Added support for Lync Server 2013 CU14 (5.0.8308.927). Thanks to Geir for submitting the info.
  3. added -SkipUpdateCheck to skip update check

v2.3 – 09-09-2015

  1. Added support for Skype for Business Server 2015 CU2 (6.0.9319.72)
  2. Added default of “Unknown version”. Thanks to Bernard for the idea.
  3. Code optimization
  4. server name is now only displayed as NetBIOS name to help reduce wordwrap (was previously FQDN). It’s red if the version is not the latest (or unknown), and green if it’s the latest version.

v2.2 – 07-14-2015

  1. Added support for Lync Server 2010 CU16 (4.0.7577.713) – Thanks to Martin for pointing it out.
  2. Added support for Lync Server 2013 CU13 (5.0.8308.920)

v2.1 – 06-21-2015

  1. Added support for Skype for Business Server 2015 RTM (6.0.9319.0)
  2. Added support for Skype for Business Server 2015 CU1 (6.0.9319.45)

v2.0 – 05-12-2015

  1. fixed typo for Lync Server 2010 CU15. Thanks to @greiginsydney for pointing it out.
  2. Updated Lync Server 2013 CU 11 – original download was 5.0.8308.871, but current download of CU 11 shows as 5.0.8308.872
  3. Added support for Lync Server 2013 CU 12 (5.0.8308.887)

v1.9 – 02-19-2015

  1. Added Lync Server 2013 CU 11 (5.0.8308.871)

v1.8 – 02-09-2015

  1. Added Lync Server 2010 CU 15 (4.0.7577.710)

v1.7 – 01-01-2015

  1. Added Lync Server 2010 CU 13 (4.0.7577.707)
  2. Added Lync Server 2010 CU 14 (4.0.7577.708)
  3. Added Lync Server 2013 CU 10 (5.0.8308.866)

v1.6 – 12-12-2014

  1. Added Lync Server 2013 CU 9 (5.0.8308.857)

v1.5 – 11-21-2014

  1. Added Lync Server 2013 post CU5 (5.0.8308.803)
  2. Added Lync Server 2013 CU 7 (5.0.8308.831)
  3. Added Lync Server 2013 CU 8 (5.0.8308.834)

v1.4 – 09-24-2014

  1. Added Lync Server 2013 CU6

v1.3 – 09-02-2014

  1. Added Lync Server 2010 CU12

v1.2 – 08-07-2014

  1. Added script check for updates. This is key because each time a new cumulative update comes out, the script will be updated with version info
  2. Added some preliminary code around getting version info for OWAS servers. Need to find a graceful way of getting the server names in a OWAS farm.
  3. Added Lync Server 2013 CU5

v1.1 – 06-02-2014

  1. Tweaked the PSRemoting code block for retrieving version numbers per Chris Irons. This should resolve unexpected results when querying Lync Server 2010 pools.
  2. Filtered out “Debugging Tools” “Resource Kit Tools” “Best Practices Analyzer” and “Meeting Room Portal” which could have a higher version number and cause incorrect results – thanks to Andy G for pointing that out.
  3. Shortened some of the output text to reduce the likelihood of word wrap.

v1.0 – 05-02-2014

  1. Initial version

Script: Get-CsDatabaseUpdateStatus.ps1 – See If Your Lync Databases Are Up To Date

April 30th, 2014 14 comments

Description

Anyone who has updated a Lync or Skype for Business environment with a recent Cumulative Update knows that there are often manual steps to perform after the LyncServerUpdateInstaller.exe/SkypeServerUpdateInstaller.exe program is finished. These are often database update functions. And often, multiple functions to update the various different databases, including the CMS, monitoring, archiving, Persistent Chat, etc. I’ve run across quite a few environments where the LyncServerUpdateInstaller.exe/SkypeServerUpdateInstaller.exe is run, and nothing else is done, and the client can’t figure out why things aren’t running as they expect. Fortunately, the Test-CsDatabase cmdlet will show you the current version of the database and the expected version. But then you have to manually compare each one to determine if an update is required. Of course, there are databases on the local Front End server(s), and the SQL backend server(s). Also, it’s important to review the status of SQL mirroring, and ensuring that databases are active on the principal node and not the mirror node. And that’s just part of the patching process.

Dave Howe, of the Lync product group, and I collaborated on a script that helps streamline part of this process. Dave did a lot of the initial grunt work, so he deserves a lot of the credit. I cleaned things up and optimized per some best practices.

Among the tasks that this script performs:

Determines whether database updates are required. It performs the following checks:

  1. Detects whether the pool version is Lync Server 2013 or later, including Skype for Business
  2. Detects whether database mirroring is enabled
  3. Detects whether the primary and mirror SQL servers are online
  4. Detects whether the mirror server is principal for any databases
  5. Detects whether the local machine is a FE of the given pool
  6. Detects whether the CMS is on Lync Server 2013 or later, including Skype for Business

And returns the following info:

  1. Returns list of local databases, their versions, and whether a database update is required (if the local server is a member of the pool)
  2. Returns list of backend databases, their versions, and whether a database update is required
  3. Returns list of CMS databases, their versions, and whether a database update is required

An example output is shown below. Note that the local XDS database requires an update

Get-CsDatabaseUpdateStatus2

Syntax

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

Installation

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.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Assumptions

None

Download

v1.2 – 02-24-2018 – Get-CsDatabaseUpdateStatus.v1.2.zip

v1.1 – 04-30-2014 – Get-CsDatabaseUpdateStatus.v1.1.zip

v1.0 – 04-30-2014 – Get-CsDatabaseUpdateStatus.v1.0.zip

Changelog

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

Changelog: Get-CsDatabaseUpdateStatus.ps1

April 30th, 2014 No comments

This is the changelog page for Get-CsDatabaseUpdateStatus.ps1. You will find a complete list of released versions, their dates, and the features and issues addressed in each. Please refer to the script’s main page for more information including download links, installation details, and more.

v1.2 – 02-24-2018

  1. Updated Write-Log to v3.4
  2. Updated Get-UpdateInfo to v1.5
  3. Updated Set-ModuleStatus to v1.6
  4. Code cleanup per recommendations from refactoring

v1.1 – 04-30-2014

  1. Fixed an issue with mangled parameter blocks. Thanks to Dave for reporting it.

v1.0 – 04-30-2014

  1. Initial version