Steven,
I generally set up an array of arguments an then wrap it in a powershell
function to abstract away all the required arguments and then put the actual
dsmadmc call into a function.
Something like:
[Array]$dsmargs = "-tcps=$Host_Name","-tcpp=$Server ", "-id=$Admin_ID ",
"-pa=$TSMpw", "-tabd", "-dataonly=y", ""
dsmadmc "select server_name, current timestamp from status"
function dsmadmc ($dsm_args, $cmd)
{
$dsmadmc = "./dsmadmc.exe"
$dsmargs[6]= $cmd
& $dsmadmc $dsmargs
}
Art Colvig
Managed Service Expert
convergeone.com
-----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 3:39 PM
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
NOTICE: This email message and any attachments here to may contain confidential
information. Any unauthorized review, use, disclosure, or distribution of such
information is prohibited. If you are not the intended recipient, please
contact
the sender by reply email and destroy the original message and all copies of it.
|