I have successfully used the code below as part of a process for setting up
schedule changes to work around network maintenance:
# Save current drive letter and path.
Push-Location
# Move to location needed for TSM administrator interface.
C:
cd "\Program Files\Tivoli\TSM\baclient"
$dsmadmc="C:\Program Files\Tivoli\TSM\baclient\dsmadmc"
$domain_results = &$dsmadmc -id=tsmadmin -password=xyzzy -comma -dataonly=yes
'select node_name,domain_name from nodes'
$late_results = &$dsmadmc -id=tsmadmin -password=xyzzy -comma -dataonly=yes
'query event * * begind=08/28/2016 begint=04:01 endt=12:00'
# Return to original location.
Pop-Location
Each of the TSM administrator commands enclosed in apostrophes is on a single
line in the script; I suspect that the commands will be split in the process of
e-mail transmission.
Thomas Denier,
Thomas Jefferson University
-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of
Steven Harris
Sent: Thursday, September 01, 2016 18:39
To: ADSM-L AT VM.MARIST DOT EDU
Subject: [ADSM-L] Invoking dsmadmc from powershell
Hi All
I have to run some security checks from time to time. Its a tedious process and
error prone, so a smart person would automate this. I have no ability to
install anything so I must work with what I have
for unix I can do something like this,
=======
id=SCRIPT
SVR=TSM1
pass=somethingsecret
alias admc="dsmadmc -errorlogn=./dsmerror.log -se=${SVR} -id=$id -pa=$pass
-tabd -dataonly=y"
admc "select server_name, current timestamp from status"
admc "select location from dbspace" | xargs -I {} find {} ! -perm -g= -o !
-perm -o= -ls
=======
The second of those lists only those database files with permissions set
invalidly.
I'd like to do something similar with Windows. The equivalent of find is not
hard to do with powershell, but I'm having trouble invoking dsmadmc with
parameters
Does anyone have a magic incantation to accomplish this?
The best I've been able to come up with is
$DSM_DIR="C:\Program File\Tivoli\TSM\baclient"
$dsmadmc="$DSM_DIR\dsmadmc.exe"
$env:DSM_DIR=$DSM_DIR
$env:Path=$env:Path+";"+$DSM_DIR
$SVR="TSM1"
$id="SCRIPT"
$pass="somethingsecret"
Invoke-Command -FilePath $dsmadmc -ArgumentList '-se=$SVR -id=$id -pa=$pass
-tabd -dataonly=y "q st"''
But thats not substituting as I would like.
Thanks
Steve.
Steven Harris
TSM Admin, Canberra Australia
The information contained in this transmission contains privileged and
confidential information. It is intended only for the use of the person named
above. If you are not the intended recipient, you are hereby notified that any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact the
sender by reply email and destroy all copies of the original message.
CAUTION: Intended recipients should NOT use email communication for emergent or
urgent health care matters.
|