Tests the connection to an IBM Spectrum Protect (TSM) server by locating dsmadmc.exe, reading the TSM options file 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 the options file (dsm.opt or a differently named file) for any parameters not supplied explicitly, passes that file to dsmadmc via -optfile, 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 the options file. The password is masked in the log (********).
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 the options file (dsm.opt or a differently named file). Detected automatically if not specified; the resolved file is passed to dsmadmc via -optfile.
-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.
DsmOptPath
String
Options file that was passed to dsmadmc via -optfile.
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
Example 1, Test local TSM connection (reads all settings from dsm.opt)
Test-sqmTsmConnection
Example 2, Test remote computer with explicit user and password
The options file is resolved like in Get-sqmTsmConfiguration: -DsmOptPath, then the -optfile= of the TSM services, DSM_DIR/DSM_CONFIG, the BackupClient registry, the standard baclient paths and finally any *.opt that contains TCPServeraddress.