ADSM-L

[ADSM-L] Invoking dsmadmc from powershell

2016-09-01 18:40:52
Subject: [ADSM-L] Invoking dsmadmc from powershell
From: Steven Harris <steven.j.harris.57 AT GMAIL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 2 Sep 2016 08:39:09 +1000
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>