Execution Flow
The managed block is delimited by
* --- dtcSqlTools BEGIN --- and * --- dtcSqlTools END ---. Entries outside this block are preserved. -UseDiff forces management class to MC_B_NL.NL_42.42.NA. The tsm.opt path is auto-discovered via env vars → registry (IBM/Tivoli) → standard candidate paths.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| -ComputerName | String | Optional | Target server. Default: local computer. |
| -SqlInstance | String | Optional | SQL Server instance used to read the backup directory. Default: ComputerName. |
| -DsmOptPath | String | Optional | Explicit path to dsm.opt. Auto-discovered when omitted. |
| -BackupDirectory | String | Optional | Base backup directory. Defaults to the value from the SQL Server instance. |
| -AdditionalIncludePaths | String[] | Optional | Extra directories added as INCLUDE entries (with default management class). |
| -ManagementClass | String | Optional | Default TSM management class (pattern MC_*). Default: MC_B_NL.NL_42.42.NA. |
| -ExcludePatterns | String[] | Optional | Custom EXCLUDE patterns. Defaults to *.ldf, *.mdf, *.ndf. |
| -IncludeRule | Hashtable[] | Optional | Per-path management class: @{ Path='...'; ManagementClass='...' }. Overrides the User-db/Sys-db defaults. |
| -UseInclExclFile | Switch | Optional | Resolve the INCLEXCL option from dsm.opt and write the managed block into that referenced file. |
| -InclExclPath | String | Optional | Explicit path to the include/exclude file (overrides -UseInclExclFile). Created if missing. |
| -UseDiff | Switch | Optional | Force management class to MC_B_NL.NL_42.42.NA (required for diff backup strategy). |
| -SqlCredential | PSCredential | Optional | SQL credentials for reading the backup directory. |
| -Credential | PSCredential | Optional | Credentials for remote file access. |
Return Value
Returns PSCustomObject: ComputerName, DsmOptPath, TargetFile, BackupDirectory, ManagementClass, UseDiff, ExcludesWritten, IncludesWritten, BackupCreated, Status, Message, ReportPath.
Examples
Example 1 — Local, auto-discover everything
Invoke-sqmTsmConfiguration -ManagementClass MC_B_NL.NL_42.42.NA
Example 2 — Remote server with diff mode
Invoke-sqmTsmConfiguration -ComputerName "SQL01" -UseDiff
Example 3 — Write into INCLEXCL file with custom rules
Invoke-sqmTsmConfiguration -ComputerName "SQL01" -UseInclExclFile `
-ExcludePatterns 'S:\...\*', '*:\...\*.ldf', '*:\...\*.mdf', '*:\...\*.ndf' `
-IncludeRule @(
@{ Path = 'F:\SQL\Backup\...\*'; ManagementClass = 'MC_B_NL.NL_35.35.NA' },
@{ Path = 'F:\SQL\Backup\01Year\*'; ManagementClass = 'MC_B_NL_NL_365.365.NA' }
)
Example 4 — WhatIf preview
Invoke-sqmTsmConfiguration -ComputerName "SQL01" -WhatIf