Inventory & Configuration Baseline

Status: Reviewed (deep-dive v1)
Stack: PowerShell collect → SQL store/procs → Blazor Server UI
Goal: Know every SQL instance you manage, what it looks like today, and when it drifts.


Why this first

Backup, index, security, and capacity work all assume a trustworthy inventory. Without it you maintain ghosts and miss real servers.


What “good” looks like


Checklist — collect (PowerShell)

Run against AD-discovered Windows servers (or a known host list). Prefer SMO / SqlServer module where available; fall back to registry + WMI.

Keep collectors idempotent and off-peak. One script family, parameterized by host list.


Checklist — store (SQL + stored procedures)

Suggested minimal schema (names flexible; keep stable keys):

Table Purpose
dbo.SqlInstance One row per instance (natural key: host + instance)
dbo.SqlInstanceConfig Latest config snapshot columns
dbo.SqlInstanceConfigHistory Prior snapshots for drift
dbo.SqlTempdbFile Current tempdb file layout
dbo.SqlLinkedServer Linked server inventory
dbo.CollectRun Run id, start/end, source, row counts, errors

Procs (lean set):

Retention: keep history ≥ 90 days (or until confirmed with Rick). Failures logged on CollectRun, not silent.


Checklist — present (Blazor Server)

Map UI fields 1:1 to proc result sets — avoid ad-hoc SQL in the UI layer.


Practical thresholds (starting defaults)

Check Flag when
Collect freshness LastSeenAt older than 24–48 hours
Max memory Unset / default on dedicated SQL host, or > 90% of RAM without leaving OS headroom (~4–8 GB+ depending on host)
tempdb files Single data file on multi-core OLTP (review); unequal sizes
Agent Critical instance and Agent not running
Build Below agreed CU/GDR target (see Patching topic later)

Tune numbers with Rick once real hosts are in the catalog — don’t invent estate-wide policy yet.


Operator runbook (short)

  1. Open Blazor inventory catalog → filter Drift or Stale collect
  2. Open instance → note what changed (config history)
  3. If unexpected: confirm with change log / owner before reverting
  4. If collect failed: check PS run log + SQL CollectRun error; fix connectivity/permissions; re-queue
  5. New server in AD but missing from catalog: add to allowlist / OU scope, re-run discover

Permissions notes


Done definition for this topic


Next after this

Backup & restore readiness — uses this inventory as the population list.


SQL Dude — SQL-01 Inventory Baseline v1