Home / Guides / Find outdated Ola Hallengren and First Responder Kit installs
Find which SQL Servers run an outdated Ola Hallengren or First Responder Kit
Ola Hallengren's Maintenance Solution and Brent Ozar's First Responder Kit are installed by running a script, so nothing ever
updates them. Years later one server has last year's backup procedure and another has a copy in master that nobody
remembers. This guide shows where each tool keeps its version, a read-only PowerShell script that compares every instance with the
latest published version, and where the comparison stops.
Short answer.
Ola Hallengren puts a line --// Version: yyyy-MM-dd HH:mm:ss inside each of its procedures, so read it from the procedure
definition (sys.sql_modules). The First Responder Kit reports its own version: run
EXEC sp_Blitz @VersionCheckMode = 1, @Version = @v OUTPUT, @VersionDate = @d OUTPUT and it returns without running any check.
Compare both with the version in the newest script on GitHub, on every instance and in every database, because both tools can be
installed in any database you like.
Where each tool keeps its version
- Ola Hallengren Maintenance Solution. The version is a timestamp, not a number. In the downloaded
MaintenanceSolution.sqleach procedure (CommandExecute,DatabaseBackup,DatabaseIntegrityCheck,IndexOptimize) carries a comment line--// Version: 2026-09-12 15:02:38 //--, and the procedures read it from their own definition when they write their start message to the job output. So the installed version is whatever that comment says in the database where you installed it. The script installs into the database named on its firstUSEline,masterby default, but plenty of people use aDBAdatabase. - First Responder Kit. Each procedure (
sp_Blitz,sp_BlitzFirst,sp_BlitzCacheand the others) has a@Versionand a@VersionDateoutput parameter, and@VersionCheckMode = 1makes it return those and stop. The kit is also installed into whichever database you ran the script in.
Reading a definition needs permission to see it. Microsoft documents that OBJECT_DEFINITION returns NULL when the caller has no
permission on the object, and the definition of a user object is visible to its owner and to people with VIEW DEFINITION (implicit
for db_owner and sysadmin). The same applies to sys.sql_modules. Run the check as a DBA, or a missing
definition looks exactly like "not installed".
Check one instance by hand
Ola Hallengren, in the database where it is installed:
SELECT o.name,
SUBSTRING(m.definition, CHARINDEX(N'--// Version: ', m.definition) + 14, 19) AS version
FROM sys.sql_modules AS m
JOIN sys.objects AS o ON o.object_id = m.object_id
WHERE o.schema_id = SCHEMA_ID(N'dbo')
AND o.name IN (N'CommandExecute', N'DatabaseBackup', N'DatabaseIntegrityCheck', N'IndexOptimize')
AND CHARINDEX(N'--// Version: ', m.definition) > 0;
First Responder Kit, in the database where it is installed:
DECLARE @v varchar(30), @d datetime;
EXEC dbo.sp_Blitz @VersionCheckMode = 1, @Version = @v OUTPUT, @VersionDate = @d OUTPUT;
SELECT @v AS version, CONVERT(char(8), @d, 112) AS version_date;
Then look at the newest version: the top of the latest MaintenanceSolution.sql on the
Ola Hallengren GitHub repository, and the
@VersionDate line of Install-All-Scripts.sql in the
First Responder Kit repository.
Check many instances in PowerShell
The script downloads the two public scripts once to learn the latest versions (or you pass them in), then connects to each instance with your
Windows login and searches every online database for either tool. It reports the oldest of the four main Ola procedures, so a half-updated
install is flagged. It changes nothing. It uses System.Data.SqlClient, which ships with Windows PowerShell 5.1, so no module is
needed, and it trusts the server certificate in the connection string; remove TrustServerCertificate=True if your servers have a
certificate your machine trusts.
<#
.SYNOPSIS
Report which SQL Server instances run an outdated Ola Hallengren Maintenance Solution or
Brent Ozar First Responder Kit. Read-only: it only reads procedure definitions and
calls sp_Blitz with @VersionCheckMode = 1.
.EXAMPLE
.\Check-MaintenanceToolVersions.ps1 -Instance 'SQL01','SQL02','SQL03\REPORTING'
.NOTES
The latest versions are read from the two public GitHub scripts. On a machine without
internet access, pass them yourself: -LatestOla '2026-09-12 15:02:38' -LatestFrk '20261114'
#>
param(
[Parameter(Mandatory)][string[]]$Instance,
[string]$LatestOla,
[string]$LatestFrk
)
# 1. What is the latest published version?
if (-not $LatestOla) {
$u = 'https://raw.githubusercontent.com/olahallengren/sql-server-maintenance-solution/master/MaintenanceSolution.sql'
$txt = [string](Invoke-WebRequest -Uri $u -UseBasicParsing).Content
if ($txt -match '--// Version: (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})') { $LatestOla = $Matches[1] }
else { throw 'Could not find the version line in the Ola Hallengren script.' }
}
if (-not $LatestFrk) {
$u = 'https://raw.githubusercontent.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/main/Install-All-Scripts.sql'
$txt = [string](Invoke-WebRequest -Uri $u -UseBasicParsing).Content
if ($txt -match "@Version = '([\d.]+)', @VersionDate = '(\d{8})'") { $LatestFrk = $Matches[2] }
else { throw 'Could not find the version line in the First Responder Kit script.' }
}
Write-Host "Latest Ola Hallengren: $LatestOla Latest First Responder Kit: $LatestFrk"
# 2. In every online database, read what is installed. Runs on each instance as the current Windows user.
$tsql = @"
SET NOCOUNT ON;
CREATE TABLE #found (DatabaseName sysname, Tool nvarchar(10), Installed nvarchar(30));
DECLARE @db sysname, @sql nvarchar(max);
DECLARE dbs CURSOR LOCAL FAST_FORWARD FOR
SELECT name FROM sys.databases WHERE state = 0 AND HAS_DBACCESS(name) = 1;
OPEN dbs; FETCH NEXT FROM dbs INTO @db;
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = N'USE ' + QUOTENAME(@db) + N';
-- Ola Hallengren: every procedure carries its own "--// Version: yyyy-MM-dd HH:mm:ss" line.
-- Take the OLDEST of the four main ones, so a half-updated install is not reported as current.
INSERT #found
SELECT DB_NAME(), N''Ola'', MIN(SUBSTRING(m.definition, CHARINDEX(N''--// Version: '', m.definition) + 14, 19))
FROM sys.sql_modules AS m
JOIN sys.objects AS o ON o.object_id = m.object_id
WHERE o.schema_id = SCHEMA_ID(N''dbo'')
AND o.name IN (N''CommandExecute'', N''DatabaseBackup'', N''DatabaseIntegrityCheck'', N''IndexOptimize'')
AND CHARINDEX(N''--// Version: '', m.definition) > 0
HAVING COUNT(*) > 0;
-- First Responder Kit: sp_Blitz reports its own version without running a check.
IF OBJECT_ID(N''dbo.sp_Blitz'', N''P'') IS NOT NULL
BEGIN
DECLARE @v varchar(30), @d datetime;
EXEC dbo.sp_Blitz @VersionCheckMode = 1, @Version = @v OUTPUT, @VersionDate = @d OUTPUT;
INSERT #found VALUES (DB_NAME(), N''FRK'', CONVERT(nvarchar(30), @d, 112));
END';
EXEC (@sql);
FETCH NEXT FROM dbs INTO @db;
END
CLOSE dbs; DEALLOCATE dbs;
SELECT DatabaseName, Tool, Installed FROM #found ORDER BY Tool, DatabaseName;
"@
$result = foreach ($i in $Instance) {
$cs = "Server=$i;Database=master;Integrated Security=SSPI;TrustServerCertificate=True;Connect Timeout=10;Application Name=MaintenanceToolCheck"
$conn = New-Object System.Data.SqlClient.SqlConnection $cs
try {
$conn.Open()
$cmd = $conn.CreateCommand(); $cmd.CommandText = $tsql; $cmd.CommandTimeout = 120
$rows = @(); $r = $cmd.ExecuteReader()
while ($r.Read()) { $rows += [pscustomobject]@{ Db = $r[0]; Tool = $r[1]; Installed = $r[2] } }
$r.Close()
foreach ($tool in 'Ola', 'FRK') {
$name = if ($tool -eq 'Ola') { 'Ola Hallengren' } else { 'First Responder Kit' }
$latest = if ($tool -eq 'Ola') { $LatestOla } else { $LatestFrk }
$mine = @($rows | Where-Object Tool -eq $tool)
if ($mine.Count -eq 0) {
[pscustomobject]@{ Instance = $i; Tool = $name; Database = ''; Installed = ''; Latest = $latest; Status = 'not installed' }
}
foreach ($m in $mine) {
[pscustomobject]@{ Instance = $i; Tool = $name; Database = $m.Db; Installed = $m.Installed; Latest = $latest
Status = if ($m.Installed -lt $latest) { 'OUTDATED' } else { 'current' } }
}
}
}
catch { Write-Warning "$i : $($_.Exception.Message)" }
finally { $conn.Dispose() }
}
$result | Format-Table -AutoSize
Save it as C:\Scripts\Check-MaintenanceToolVersions.ps1 and run it with the instance names:
C:\Scripts\Check-MaintenanceToolVersions.ps1 -Instance SQL01, SQL02, SQL03\REPORTING
# Example output
Instance Tool Database Installed Latest Status
-------- ---- -------- --------- ------ ------
SQL01 Ola Hallengren DBA 2026-09-12 15:02:38 2026-09-12 15:02:38 current
SQL01 First Responder Kit master 20261114 20261114 current
SQL02 Ola Hallengren master 2025-01-14 22:26:13 2026-09-12 15:02:38 OUTDATED
SQL02 First Responder Kit 20261114 not installed
Tested on a Windows 11 test machine with SQL Server 2025 Developer and SQL Server 2022 Express instances, against the real scripts from GitHub
as they were on the test day. Cases covered: nothing installed ("not installed"), both tools current, an old Ola version in a DBA database,
an old First Responder Kit in master, the same tool installed in several databases of one instance, an Ola install where only
IndexOptimize had been left at an older version (reported as outdated), and an instance that does not exist (a warning, the others
still reported). The old versions were made by editing the version text in a copy of the downloaded script, so the test shows how the script reads versions,
not what an old release looked like. Not tested: an availability group, Linux, or a login without VIEW DEFINITION.
Updating is a separate step
- Ola Hallengren. Download the new
MaintenanceSolution.sql, set the database on its firstUSEline to the one that already has the old copy (otherwise you create a second copy), and run it. The script only creates a job when no job with that name exists, so jobs made by an older version keep their old commands; compare them with the new script's job steps if a release changed a job. Read the script and its settings before you run it on a server. - First Responder Kit. Run the new
Install-All-Scripts.sql(or the single procedure scripts) in the database that has the kit. Each procedure script creates a stub if the procedure is missing and then runsALTER PROCEDURE, so re-running replaces the old procedures. - Duplicates. The test instance had a stale Ola copy in
masternext to a current one inDBA. The script lists both; decide which one your jobs call (look at the job steps) and remove the other, or the next person updates the wrong one.
Where comparing this way stops
- Newer is not always better on a production server. A release can change behavior. Read the release notes (Ola's version history, the kit's GitHub releases) and update on a test server first.
- Renamed or customized copies. A copy where someone renamed a procedure, stripped the comments, or encrypted it does not carry the version line; the script shows it as not installed.
- Only the main Ola procedures are read.
CommandLog, the jobs and their settings are not compared. - A snapshot. It tells you the state now; it keeps no history, does not run by itself and does not tell you when a new version appears.
- Needs the internet once. The machine that runs it must reach
raw.githubusercontent.com, or you give it the latest versions with-LatestOlaand-LatestFrk.
Questions
How do I check which version of Ola Hallengren's Maintenance Solution is installed?
Read the comment line --// Version: yyyy-MM-dd HH:mm:ss from the definition of one of its procedures, for example DatabaseBackup, in the database where you installed it (SELECT OBJECT_DEFINITION(OBJECT_ID(N'dbo.DatabaseBackup')) and look for the line). The version is a timestamp, and you compare it with the one at the top of the newest MaintenanceSolution.sql.
How do I check the First Responder Kit version?
Run EXEC sp_Blitz @VersionCheckMode = 1 with the @Version and @VersionDate output parameters. It returns the version without running any check. Most of the other Blitz procedures take the same parameters, so you can check them one by one if only some were updated.
Does running the new Ola Hallengren script update my jobs?
No. The script creates a job only when no job with that name exists, so existing jobs keep their old steps. The procedures are replaced, which is usually what matters; compare the jobs with the new script if a release changed them.
Why does my server show two copies of the Maintenance Solution?
The script installs into the database on its first USE line, master by default. If someone later installed it into another database without removing the first copy, both exist. Check which one your job steps call, then remove the other.
Is there a tool that checks this on many servers?
SQLParity compares the Ola Hallengren and First Responder Kit versions of the servers you group together with the latest published ones and reports which are current, which can be updated and where they are not installed. It only installs or updates when you choose it on the What to do tab.
Related
- Compare SQL Agent jobs between two SQL Servers
- Compare linked servers between two SQL Servers
- SQLParity: keep your SQL Servers the same
- All guides
Sources: OBJECT_DEFINITION (Microsoft Learn), sys.sql_modules (Microsoft Learn), Ola Hallengren: version history, First Responder Kit on GitHub.