Page 1 of 1

Restart TM1-Service automatically

Posted: Fri Feb 19, 2010 1:12 pm
by Toto
Hello,

for testing purposes I installed a XP server, now I want to stop and restart the tm1-server remotely via a batch-file. In the Cognos docu I read that the netsvc command will not work with XP (I tried it and I agree). The TM1 server is running as a service. Do you have a hint how I can remotely start/stop the server automatically?

Thanks a lot,

Toto

Re: Restart TM1-Service automatically

Posted: Fri Feb 19, 2010 9:34 pm
by lotsaram
On Windows XP Net Stop and Net Start commands should work.

Eg. batch file would be
Net Stop "Planning Sample"

Re: Restart TM1-Service automatically

Posted: Wed Mar 03, 2010 4:05 pm
by Eeyore
Net Stop / Net Start work, and so do the equivalent SC commands.

The problem with both of these is that neither of them have a Restart command equivalent to the option in the Services applet, so you have to include a delay in your batch file between the Stop and the Start to allow the server to save and unload:
  • Net Stop "Planning Sample"
    Sleep 120
    Net Start "Planning Sample
If the Start executes before the TM1 service has unloaded it will fail, so the Sleep period needs to be conservative. Or you'd have to poll the status of the service and wait until it was down before continuing (probably doable using SC, but beyond my batch file writing skills).

The best solution I've found was to use Sysinternals free PsService.exe utility to restart the service. Copy it to an executable path on the server and this type of command should work in a batch file.
  • psservice restart "Planning Sample" /accepteula

Re: Restart TM1-Service automatically

Posted: Wed Nov 07, 2012 2:24 am
by jameswebber
I have had to change all my services to use a domain user who is also an admin user on the box

Then in my TM1 prolog I can do this:

vCmd = 'net stop "IBM Cognos Express Advisor"';
ExecuteCommand(vCmd,1);

vCmd = 'net start "IBM Cognos Express Advisor"';
ExecuteCommand(vCmd,1);