Show-SqlSpnDiagnostic Lists recent SPN audit log files and summarizes their contents.
Description
Resolves the log directory using the same precedence as Write-SqlSpnLog (param > $env:SQLSPN_LOG_DIR > user-profile default), then either:
- lists every audit file with size + entry counts (default),
- shows the path to the most recent file (-Latest),
- or tails the most recent file (-Tail N).
Designed to answer "what just happened?" after running Start-SqlSpnManager or Start-SqlSpnConfiguration without grepping log files by hand.
Recipes
Recipe 1
EXAMPLE 1
Show-SqlSpnDiagnostic
Recipe 2
EXAMPLE 2
Show-SqlSpnDiagnostic -Tail 20
Recipe 3
EXAMPLE 3
Get-Content (Show-SqlSpnDiagnostic -Latest)
Notes
Audit files older than 30 days are pruned automatically by Write-SqlSpnLog on first call of a new invocation, not by this command.
Parameters
-Path optional String
Override the log directory.
-Latest optional SwitchParameter
Print the path to the most recent log file and exit.
-Tail optional Int32
Tail the last N entries from the most recent log file.
Was this page helpful? Report an issue or suggest an improvement →