Moduły/Skrypty, PowerShell, SQL Server

SQLServerUpdatesModule – PowerShell

SQLServerUpdatesModule is a free PowerShell module returns information about the newest available updates for instance SQL Server.
Source for updates list  – http://sqlserverupdates.com

Minimum Requirements

Server
  • SQL Server 2008
  • PowerShell 4.0 with remoting enabled needed on the host for Windows commands
Workstation
  • Windows 7 with PowerShell v4
  • SQL Server 2008 R2 SMO or SSMS

SQLServerUpdatesModule is not required on the server.

I recommend to use the script at client stations, but I encourage to make a test at servers.

 

Install

1. Install from the PowerShell Gallery

Install-Module -Name SQLServerUpdatesModule

The PowerShell Gallery and the command Install-Module are natively available in Windows 10. If you run Windows 7 or 8 or 8.1, you can either install PackageManagement from powershellgallery.com

2. Download the zip directly and manually import the module.

Using module

Get-SQLServerUpdates – returns available updates list  (cumulatvie update, service pack) for SQL Server. Source for updates list  – http://sqlserverupdates.com/

Get-SQLServerUpdateList

Update list for all SQL Server from version 2008 to 2016.

Get-SQLServerUpdateList -Version „SQL Server 2016”

Update list only for SQL Server 2016

Additional information.

When I wrote this script I had a problem with Exception 0x800A01B6. I found solution at this site – link. In the script I use IHTMLDocument3_getElementsByTagName instead of method getElementsByTagName.

Show-SQLServerUpdatesReport  – returns information about deficit of installed updates at instance SQL Server.

Show-SQLServerUpdatesReport -Version ‚13.0.4422.0’

Returns information about deficit of installed updates for version builid SQL Server.

Show-SQLServerUpdatesReport -Version ‚12.0.4502’ | Select -Expand Updates

Returns information about deficit of installed updates for build number SQL Server. Expand properties Updates.

Show-SQLServerUpdatesReport -ServerInstance it-mn-m\mssqlserver14, test-agsqlserver

Returns information about deficit of installed updates for instance with parameter ServerInstance. This command returns objects.

Show-SQLServerUpdatesReport -ServerInstance it-mn-m\mssqlserver14, test-agsqlserver -HTML -Path C:\temp\report.html

Return information about deficit of installed updates for instances with parameter ServerInstance. This command returns report in the format html.

Example report – report.html

Errors and problems

Please send me information about errors and problems by email.