Hi Luc, OK... I gather that you go to the trouble of using WSH scripting to automate use of RunAs.
Assuming that is correct, I do not have a "RunAs" solution for you. Perhaps others on this forum have tackled this. As far as I can tell, RunAs was not designed for scripting; when I try using the scheduler in the fashion you describe, I also cannot get it to work. I tried setting the local system account to "Interact with desktop", and I tried using an admin account, but I could not make it work. I can get it to work when I run the scheduler from the desktop (dsmc sched) but that really won't fly when doing scheduled backups on Windows. However, I have found an alternative solution, CPAU, which is a freeware replacement for "RunAs". You can find it at: http://www.joeware.net/win/free/tools/cpau.htm. Instead of using a WSH script, I used a plain old .cmd file called backup.cmd that contains this one line (note that this might wrap in the email, but it is all one long command): C:\TSM\baclient\cpau.exe -u .\storman -p xxxxx -wait -outprocexit -cwd "C:\TSM\baclient" -ex "dsmc i c:\mydir\* -subdir=yes" Notes: * I do not have SAP, so my example above uses "dsmc". You will have to substitute the brbackup syntax. * I had to configure the scheduler service to log in with my admin account, as it does not work with the local system account. I have not tried it with a non-admin account. * Make sure the account you run as has any needed TSM environment variables configured. * The -wait and -outprocexit options will cause the backup.cmd script to exit with the return code from dsmc. This way, it is propagated back to the scheduler service. * The -cwd option specifies the directory where the executable (dsmc.exe) is located. This way I did not have to configure DSM_DIR, DSM_CONFIG. * The -ex option is the command string. You can also search the internet for other "RunAs" replacement tools. Obligatory caveats: The above information is provided "as is", and does not represent an endorsement of any kind, by me or IBM, for the CPAU utility; nor do we provide technical support for the utility. It is up to you to determine the value and viability of using this tool or approach to the problem. Best regards, Andy Andy Raibeck IBM Software Group Tivoli Storage Manager Client Development Internal Notes e-mail: Andrew Raibeck/Tucson/[EMAIL PROTECTED] Internet e-mail: [EMAIL PROTECTED] IBM Tivoli Storage Manager support web page: http://www.ibm.com/software/sysmgmt/products/support/IBMTivoliStorageManager.html The only dumb question is the one that goes unasked. The command line is your friend. "Good enough" is the enemy of excellence. "ADSM: Dist Stor Manager" <[email protected]> wrote on 01/18/2007 02:11:39 PM: > Any, > Andrew, > > The TSM scheduler seems to works fine and starts the script; see > scheduler log extract : > Executing scheduled command now. > 01/18/2007 07:57:04 > Executing Operating System command or script: > C:\origin\scripts\backup.vbs > 01/18/2007 07:57:06 Finished command. Return code is: 0 > 01/18/2007 07:57:06 ANS1908I The scheduled command completed > successfully. > 01/18/2007 07:57:06 Scheduled event 'SAP_XIT' completed successfully. > 01/18/2007 07:57:06 Sending results for scheduled event 'SAP_XIT'. > 01/18/2007 07:57:06 Results sent to server for scheduled event > 'SAP_XIT'. > > The script is scheduled with the TSM scheduler. > > The TSM job defs: > tsm: UT1_TSM>q sched GLO_UT1_W2K SAP_XIT f=d > > Policy Domain Name: GLO_UT1_W2K > Schedule Name: SAP_XIT > Description: SAP ONLINE XIT > Action: Command > Options: > Objects: C:\origin\scripts\backup.vbs > Priority: 5 > Start Date/Time: 12/03/06 08:12:59 > Duration: 3 Hour(s) > Period: 1 Day(s) > Day of Week: Any > Expiration: > Last Update by (administrator): ADMIN > Last Update Date/Time: 01/18/07 21:33:33 > Managing profile: > > > The script: > > set WshShell = CreateObject("WScript.Shell") > WshShell.Run "runas /user:xitadm ""H:\usr\sap\XIT\SYS\exe\run\brbackup > -u / -c force -m all -t online_cons""" > WScript.Sleep 10 > WshShell.Sendkeys "pwdtix~" > > > Thanks for your help. > > Regards > Luc > > -----Original Message----- > From: Andrew Raibeck [mailto:[EMAIL PROTECTED] > Sent: donderdag 18 januari 2007 16:02 > To: [email protected] > Subject: Re: Start vbs script with TSM > > Hi Luc, > > The answer to your question is "yes". :-) > > If you would like help with this, please provide the details of your > implementation and results, including (but not limited to) detailed > schedule definition, script, dsmerror.log, dsmsched.log, how the script > is being launched (hopefully in the schedule definition), etc. > > Regards, > > Andy > > Andy Raibeck > IBM Software Group > Tivoli Storage Manager Client Development Internal Notes e-mail: Andrew > Raibeck/Tucson/[EMAIL PROTECTED] Internet e-mail: [EMAIL PROTECTED] > > IBM Tivoli Storage Manager support web page: > http://www.ibm.com/software/sysmgmt/products/support/IBMTivoliStorageMan > ager.html > > The only dumb question is the one that goes unasked. > The command line is your friend. > "Good enough" is the enemy of excellence. > > "ADSM: Dist Stor Manager" <[email protected]> wrote on 01/18/2007 > 07:47:05 AM: > > > Hi all, > > > > On our unix systems we are scheduling our backups with the TSM > scheduler > > that works fine. On our Windows systems we have created some vbs > > scripts that we want to start with the TSM scheduler however it > > doesn't work. > > > > According to the schedule log the script starts and give a rc 0, but > > nothing happens. We want to kickoff a SAP backup. > > > > Has anyone of you faced the same problem? > > Regards, > > > > Luc > > > > Managed Services Unix > > Da Vincilaan 5 - Corporate Village > > B-1930 Zaventem > > Phone: +32 (0)2 690 27 66 > > Fax: +32 (0)2 690 27 82 > > > > GSM: +32 (0)474 98 24 25 > > e-mail: [EMAIL PROTECTED]
