Execution Flow
START
_FindDsmadmcPath: Registry → DSM_DIR → defaults
dsmadmc
found?
ERROR + return
NO
Missing user/pwd/server? → Get-sqmTsmConfiguration (reads dsm.opt)
UserName
resolved?
ERROR + return
NO
Password
resolved?
ERROR + return
NO
_SecureToPlain → plaintext password (in-memory)
Build: -id= -password= -se= -dataonly=yes show version
isLocal?
(localhost check)
if isLocal
ProcessStartInfo
+ RedirectOutput
NO
if remote
New-PSSession
+ Invoke-Command
ExitCode=0
&& "IBM Spectrum Protect"?
Success=true
YES
Success=false
NO
Return $result [PSCustomObject]
DONE
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.
Syntax
Test-sqmTsmConnection
[-ComputerName <String>]
[-DsmadmcPath <String>]
[-UserName <String>]
[-Password <SecureString>]
[-ServerName <String>]
[-DsmOptPath <String>]
[-Credential <PSCredential>]
[-EnableException ]
Parameters
Parameter Type Default Description
-ComputerName String $env:COMPUTERNAME 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
Example 1 — Test local TSM connection (reads all settings from dsm.opt)
Test-sqmTsmConnection copy
Example 2 — Test remote computer with explicit user and password
Test-sqmTsmConnection -ComputerName "SQL01" `
-UserName "tsm_admin" -Password (Read-Host -AsSecureString )copy
Example 3 — Test with explicit dsmadmc path and WinRM credential
Test-sqmTsmConnection -ComputerName "BACKUP01" `
-DsmadmcPath "C:\IBM\TSM\baclient\dsmadmc.exe" `
-Credential (Get-Credential )copy
dsmadmc.exe Auto-Detection Order
Priority Source Path / Key
1 Registry HKLM:\SOFTWARE\IBM\ADSM\CurrentVersion\InstallPath + dsmadmc.exe
2 Environment %DSM_DIR%\dsmadmc.exe
3 Default (Tivoli) C:\Program Files\Tivoli\TSM\baclient\dsmadmc.exe
4 Default (IBM TSM) C:\Program Files\IBM\TSM\baclient\dsmadmc.exe
5 Default (Spectrum) C:\Program Files\IBM\SpectrumProtect\baclient\dsmadmc.exe