Test-SqlSpnPlan Validates a plan object's shape before execution.
Description
Confirms the plan carries the expected fields (AccountDn, ProposedSpns, Role) and that ProposedSpns is non-empty. Forest-wide duplicate detection runs inside Invoke-SqlSpnExecutionEngine (setspn -Q with optional -T) where it can surface conflicts as structured warnings; this command is the cheap local-shape check that runs before the expensive AD round-trip.
Recipes
Recipe 1
EXAMPLE 1
$plan | Test-SqlSpnPlan
Recipe 2
EXAMPLE 2
$result = Test-SqlSpnPlan -SpnPlan $plan
if ($result.Status -ne 'Clear') { throw "Plan invalid: $($result.Reason)" }
Notes
Status meanings: Clear - shape is valid and plan is non-empty; safe to pass to engine. Invalid - missing one or more required fields; plan was not built correctly. Empty - plan has zero proposed SPNs; nothing to register.
Parameters
-SpnPlan required Object pipeline
A plan object produced by New-SqlSpnPlan.
Was this page helpful? Report an issue or suggest an improvement →