[ADSM-L] Invoking dsmadmc from powershell
2016-09-01 18:40:52
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
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [ADSM-L] Invoking dsmadmc from powershell,
Steven Harris <=
|
|
|