Archive

Archive for April, 2014

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

Module: ExchangeServices – Functions to stop/start/query Exchange services

April 1st, 2014 1 comment

Description

Exchange 2013 logo 128x128Being someone who’s converted from Exchange to Lync, I have the luxury of cmdlets for managing Lync services. This includes starting, stopping, and querying those services. I’ve heard from a few Exchange guys who have said it would be nice if the Exchange guys had the same ability. Sure, you can manually type a PowerShell query each time, but why not convert that into some functions? I’ve created a module that has three functions in it. Start-ExWindowsService, which will start any Exchange service that is not disabled and not currently running. Stop-ExWindowsService will stop all running Exchange services. Get-ExWindowsService, which will display all Exchange services and their status and startup type. And finally, Set-ExWindowsServiceRecoveryOptions sets all Exchange related services to automatically restart in the event of a service failure.

 

Syntax

Start-ExWindowsService [[-ComputerName] ] [[-Name] ] [-WhatIf] [-Confirm] []
Stop-ExWindowsService [[-ComputerName] ] [[-Name] ] [-Force] [-WhatIf] [-Confirm] []
Get-ExWindowsService [[-ComputerName] ] [[-Name] ] [-WhatIf] [-Confirm ] []
Set-ExWindowsServiceRecoveryOptions [[-ComputerName] ] [-WhatIf] [-Confirm]

Installation

Open PowerShell and type $env:PSModulePath. Note that it will generally include two paths. One is to c:\Windows\System32\WindowsPowerShell\v1.0\Modules\. Placing the module in this location will make it available to everyone who uses that computer. The other path is to a subfolder of your My Documents folder. Something like C:\Users\administrator\Documents\WindowsPowerShell\Modules. Placing the module in there will make it available just to you. In either case, unzip the contents of the zip file, including the folder, to the modules folder. One thing to note: if you place the module in your personal modules folder, it will not show in the list when you run Get-Module -ListAvailable. But it will still work fine. Import the module by typing Import-Module ExchangeServices

Download

v1.1 – 01-26-2015 – ExchangeServices.v1.1.zip

v1.0 – 04-01-2014 – ExchangeServices.v1.0.zip

Changelog

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

 

Categories: Exchange Server, PowerShell Tags:

Changelog: ExchangeServices

April 1st, 2014 No comments

This is the changelog for ExchangeServices. 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.0 – 04-01-2014

  1. Original version
Categories: Exchange Server Tags: