Board Broadcasting as scheduled task
Hello Community,
I set up the Broadcast functionality of Board to one of our clients and now we would like to schedule it to run every day. So, I create a bat file using the BoardWinClient.exe syntax. The script works find it sends emails with excel files attached. The problem is when I set it as a scheduled task in windows server it doesn’t work.
I can see the BoardMailer running in task manager, but I don’t receive emails.
Does anyone encounter this problem before? or have similar experience?
I would like to hear from you guys,
Thanks
Ahmed Lattali
Answers
-
Hi Ahmed,
which Windows User are you using to run this scheduled task ("When running the task, use the following user account").
If you are using a System user or a user without an active desktop (user with active desktop = connected user) you can experience this behavior because the Board Windows Client needs interaction with desktop in order to open screens, execute reports and extract them into files to be sent through Board Mailer.
So please check the user which runs the task and keep its desktop active during this task.
Let me know
Domenico
4 -
Hi Domenico,
Thanks for your response, yes I use a user that I can connect with using RDP. Could you please tell me what do you mean by active desktop ? is it a feature in windows server ?
0 -
Hi Ahmed,
when I say "active desktop" I mean that this user should never logoff. Its desktop should be always "on", even if you are not physically connected through RDP.
Domenico
3 -
Okay, but even if i connect with RDP and launch the task manually (from the task scheduler) it doesn't work.
what confuse me is that if i launch the .bat file that i use in the task scheduler it works fine.
Thnx
4 -
hi,
if you're starting the batch file, it can run in Your windows userspace (using your standardoutput [i,e,monitor] etc). If you're running it in task scheduler you need to choose "Run only when user is logged on" [and you shouldnt log off the user], cause otherwise the batch cant interact with an graphical standard output (i.e. monitor) and so it cant export for example files to MS Excel.
Regards
Björn
1 -
Hi,
Thanks Björn, when I check “Run only when user is connected” the scheduled task works,
but is there a way to keep the user logged in all the time ?
2 -
I've found that you can logoff from your session not by closing RDP or logging off (both will logoff the user) but through a simple .bat on desktop with this code:
tscon %sessionname% /dest:console
It works for me
Let us know
Domenico
4 -
Could the Board Procedure Launcher be used to run this procedure instead, also as a scheduled task?
4 -
Hi Jonathan,
Broadcast can be executed only through the Board Windows Client command line method (see Opening a Capsule from a Command Line).
Board Procedure Launcher is recommended for all database procedures that do contain only server side actions (no Broadcast, Refresh Office File, Interactive Selections and so on - please refer to BOARD Procedure Launcher).
Domenico
2 -
Thanks Domenico,
The scheduled task works, even if I disconnect from the RDP using the red x the user still logged in
You and Björn Reuber both helped me I really appreciate it but I don’t know which answer should I mark as correct
1 -
We use Board Procedure Launcher to run email broadcast from Windows Task Scheduler. It was set up for us by Board consulting and works well. We run it 8 times per day.
5 -
hello Peter DeGregorio,
are you sure?
with Board Procedure Launcher Only database procedure can be called with this utility and must contain only "server-side" actions.
And the Broadcast procedure action is a "capsule only" action (it uses a screen, which is a capsule-component).
could you paste here the instructions inserted in the .bat launched by the windows task scheduler?
regards,
federico
2 -
Yes I'm quite sure. The Windows Task Scheduler runs broadcast1.bat (there are 4 of them which run twice a day).
The .bat files contain the following
"C:\Program Files (x86)\Board\Board Client\BoardWinClient.exe" /host "localhost:9700" /username "x" /password "x" /Capsule "FolderX\CapsuleX.cpsx" /Screen "onopen-x" /unattended
That screen runs a procedure on open which does the email.
I have found that it is best when testing to not run the .bat file directly (because it opens the Win client) but rather run the .bat file from the Task Scheduler on demand.
Hope this helps
Pete
3 -
Hi Peter DeGregorio,
This is not the Board Procedure Launcher syntax, it is the old one, as Federico Cazzalini mentioned above : Only database procedure can be called with this utility and must contain only "server-side" actions. but in the case of Broadcasting this is the syntax that should be used
Best regards,
Ahmed Lattali
1 -
Yes. My mistake. It may be the old one but it is the only one that works not signed on as far as I know.
1 -
Do you mean in the scheduled task you didn't have to check "run only when user is logged in" ?
I used the same syntax as yours in my bat file
0 -
Yes ... on the task "Run whether user is logged on or not" is selected.
In case it is useful:
The OS is Windows Server 2012 R2 Standard.
The task is run by a domain user named "board'. This user is a "developer-visitor" in Board security.
The bat file calls Board win client with user "broadcaster". This user is a Lite in Board security and is a password-authenticated user.
1 -
Thanks for the info Peter DeGregorio I will try to do the same
0 -
Dear Domenico Panetta,
How can I capture the return code after running the "Board Procedure Launcher" called by Windows Task Scheduler?
Do you have any suggestions?
Thanks,
Selvet.
0 -
Hi Selvet,
you can catch Board Procedure Launcher return codes through the Command Prompt functionalities STDERR/STDOUT.
Just extend the batch file (.bat) with following commands:
- For the Standard Output:
"C:\Program Files\Board\Board Server\Tools\BoardProcedureLauncher.exe" /host "localhost:9700" /username "myuser" /password "mypassword" /Procedure "myprocedure" /DataBase "mydatabase" 1> myprocedure_regular.log
- For the Standard Error:
"C:\Program Files\Board\Board Server\Tools\BoardProcedureLauncher.exe" /host "localhost:9700" /username "myuser" /password "mypassword" /Procedure "myprocedure" /DataBase "mydatabase" 2> myprocedure_error.log
- For both
"C:\Program Files\Board\Board Server\Tools\BoardProcedureLauncher.exe" /host "localhost:9700" /username "myuser" /password "mypassword" /Procedure "myprocedure" /DataBase "mydatabase" 1> myprocedure_full_execution.log 2>&1
If you do not give a specific path for the log file (notice: it could be also .txt, .msg...), this will be put in the same path of the batch file.
You can find more details in the original Microsoft KB article:
https://support.microsoft.com/en-us/help/110930/redirecting-error-messages-from-command-prompt-stderr-stdoutHope this helps you
RegardsDomenico
3 - For the Standard Output: