Tests the connection to an IBM Spectrum Protect (TSM) server by locating dsmadmc.exe, reading dsm.opt for credentials, and running a 'show version' command — locally or via WinRM on a remote computer.
Execution Flow
Synopsis
Locates dsmadmc.exe via registry (HKLM:\SOFTWARE\IBM\ADSM\CurrentVersion), the %DSM_DIR% environment variable, or standard install paths. Reads the TSM configuration from dsm.opt for any parameters not supplied explicitly, then executes dsmadmc show version to verify connectivity. Remote computers are accessed via WinRM (New-PSSession / Invoke-Command).
Does not require dbatools. Uses Invoke-sqmLogging and an internal helper Get-sqmTsmConfiguration to read dsm.opt.
Target computer where the connection test is performed.
-DsmadmcPath
String
auto-detect
Full path to dsmadmc.exe. Detected automatically from registry/env if omitted.
-UserName
String
dsm.opt USERID
TSM user name. Read from dsm.opt USERID if not supplied.
-Password
SecureString
dsm.opt PASSWORD
TSM password. Read from dsm.opt PASSWORD if not supplied.
-ServerName
String
dsm.opt TCPServeraddress
TSM server address. Read from dsm.opt if not supplied.
-DsmOptPath
String
auto-detect
Full path to dsm.opt. Detected automatically if not specified.
-Credential
PSCredential
—
Windows credential for WinRM access to a remote computer.
-EnableException
Switch
false
Throw terminating exceptions instead of returning a failure object.
Return Value
Property
Type
Description
Success
Bool
True if dsmadmc exited with code 0 and output contains "IBM Spectrum Protect".
Message
String
Human-readable result or error description.
DsmadmcPath
String
Path to the dsmadmc.exe that was used.
ServerName
String
TSM server address that was contacted.
UserName
String
TSM user name that was used.
Output
String
Standard output from dsmadmc.
ErrorOutput
String
Standard error output from dsmadmc.
Examples
# Test local TSM connection (reads all settings from dsm.opt)Test-sqmTsmConnection# Test remote computer with explicit user and passwordTest-sqmTsmConnection-ComputerName"SQL01" `
-UserName"tsm_admin"-Password (Read-Host-AsSecureString)
# Test with explicit dsmadmc path and WinRM credentialTest-sqmTsmConnection-ComputerName"BACKUP01" `
-DsmadmcPath"C:\IBM\TSM\baclient\dsmadmc.exe" `
-Credential (Get-Credential)