Execution Flow
"CommandLog missing" is reported as a warning, not a failure — Ola's solution can run with
@LogToTable = 'N', so its absence doesn't necessarily mean the maintenance jobs are broken, just that their execution history isn't being logged to a table. Pairs with Install-sqmOlaMaintenanceSolution and New-sqmOlaMaintenanceJobs.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| -SqlInstance | String | Optional | SQL Server instance. Default: local computer name. |
| -SqlCredential | PSCredential | Optional | SQL authentication credential for the connection. |
| -RequiredSet | String | Optional | Which components to additionally verify: Backup (default, just DatabaseBackup), Integrity (adds DatabaseIntegrityCheck), or Index (adds IndexOptimize too). |
Return Value
Returns a single PSCustomObject with: IsInstalled, AgentRunning, PresentObjects (array of found procedure names), Warnings (array), Message.
Examples
Example 1 — Check for the base backup procedures
Test-sqmOlaInstallation -SqlInstance "SQL01"Example 2 — Require integrity check + index maintenance too
Test-sqmOlaInstallation -SqlInstance "SQL01" -RequiredSet IndexExample 3 — Gate installation on the result
$r = Test-sqmOlaInstallation -SqlInstance "SQL01"
if (-not $r.IsInstalled) { Install-sqmOlaMaintenanceSolution -SqlInstance "SQL01" }