FileMaker Task Automation - filemaker

I'd like to automate several FileMaker tasks using Windows Task Scheduler. It looks like step scripts are the way to go, but I'm not sure. I'd like to run tasks, say exporting for example, several times per day, but WITHOUT opening the FileMaker GUI. Is that possible? Any tips you have would be great. Thanks.

It's possible to initiate a Filemaker script using a schedule server script with Filemaker Server. However, if the database is not hosted using Filemaker server, or not open using Filemaker Pro (sounds like your situation), then there is no active engine able to actually perform the calculations (script steps, etc). The database has to be running somewhere to initiate and perform any scripts.
If the database is hosted using Filemaker Server then it is pretty easy to setup a scheduled script that will run at a designated time. If you don't have a license of Filemaker Server some Filemaker cloud hosting providers have monthly plans that are relatively cheap ($20/month with unlimited connections), and they'll work with you to setup a scheduled script (for free).

The best way to automate FileMaker tasks is to use FileMaker Server which has scheduled scripts. Of course it is more expensive than standalone version of FileMaker Pro.
If you automate tasks on a local FileMaker file, you can not avoid starting FileMaker and opening the file.
FileMaker has a limited support for VBScript, you can run FileMaker, open file and run a FileMaker Script from VBScript and add that script to Windows Task Scheduler.

This is not preferable way, but if you have no other option, this may be handy.
in Task Scheduler, Create a task
on Action tab, choose
"Start Program"
on the next screen, point to FileMaker Pro exe file, typically it is in C:\Program Files\Filemaker Pro\FileMaker.exe
Add argument:
"fmp://hostName/fileName.fmp12?script=scriptName&param=optionalScriptParameters"
please read more here http://www.filemaker.com/help/12/fmp/en/html/sharing_data.16.7.html about url schema. This will vary depending on whether you are hosting your file on FileMaker Server or opening it locally.
Note: avoid having spaces or special characters in script name.
Save the task. Reopen task properties and save your windows account credentials, so that the task may run without you having to login.
either save FileMaker login credentials upon login (if your FM version allows), or pass credentials through fmp url (as described in the link above), or go to FileMaker file options, and use credentials in "Log in using": (which is not secure and not recommended).
I am using this method to automatically send emails with PDF attachments, since FileMaker server does not let you Export Records as PDF (not until v.16) on server scripts.

Related

Wix toolset - powershell script msi creation

I have a new project at work, for customer, that require me to do an OEM image creation.
The pre
The idea would be deploy OEM image, it will install, and deploy all software, and then shutdown. Once started back up it will prompt users to chose pc name, select Domain to join and regional settings.
I think i can do this by using a powershell script and wrapping it up in an msi and add it to MDT with no silent install switches (so that it prompts users to manually go through the steps)
Now my issue is how do i inject a powershell script as well as ensure that if this scipt has user input required, that it actually prompts the user to input the data (is this even possible with Wix?)
WiX is able to install files, configure Windows settings, interact with SQL Servers, and etc, but you are working with an installer file. It is not possible to receive input from the end user after a system reboot from WiX alone since you can run a PowerShell script while the system is active, but once it restarts, the process will get terminated and has to be restarted. Unless there is some way to schedule the PowerShell script in Windows such as running it from a service created in C#.

Run Powershell script every hour on Azure

I have found this great script which backs up SQL Azure database to BLOB.
I want to run many different variations of this script - e.g. DB1 goes to Customer1Blob, DB2 goes to Customer2Blob.
I have looked at Scheduler Job Collections. However I can only see options (Action settings) for HTTP(S)/ Storage Queue / Service Bus.
Is it possible to run a specific .ps1 script (with commands) scheduled?
You can definitely run a Powershell script as a WebJob. If you want to run a script on a schedule, you can add a settings.job file containing a chron expression with your webjob. The docs for doing so are here.
For this type of automation tasks, I prefer to use the Azure Automation service. You can create runbooks using powershell and then schedule this with the use of the Azure scheduler. You can have it run "on azure" so you do not need to use compute power that you pay for (rather you pay by the minute the job runs) or you can configure it to run with a hybrid worker.
For more information, please see the documentation
When exporting from SQL DB or from SQL Server, make sure you are exporting from a quiescent database. Exporting from a database with active transactions can result in data integrity issues - data being added to various tables while they are also being exported.

Task Scheduler - MS Access can't send email via MS Outlook

Recently we updated our systems to Office 2016. I have a scheduled task that reads information in an MS Access DB and then sends this information to a mail recipient via Outlook. All was fine until the upgrade.
The Scheduled task launches a .bat file which opens MS Access, calls a function, performs a task and then send the the information via email using outlook.
When I run the batch file manually by double clicking on it, it works as intended and sends the email. However, when I run through Task Scheduler it does not work. I know for certain that it opens the MS Access file and can read, but for some reason it fails to send the email. I have lowered all security setting to no avail.
The scheduled task runs with the highest privileges and all was fine before the upgrade.
Does anyone have any suggestions.
Outlook has security settings that will prevent an application from sending e-mail through it programmatically. It will use a popup dialog to ask for permission to send the e-mail. While I have successfully gotten rid of the popup and made Access send through Outlook while Outlook is open (both manually and as a scheduled task), it still fails when Outlook is not already open.
Your best bet, if you have the capability, is to leave Outlook open on the machine that runs the scheduled task. Otherwise you have to try to figure out what combination of policies and registry/outlook settings will make Outlook work the way you want it to.
Edit: My experience is with a windows domain/local exchange server environment.
We upgraded to Office 2016 a few weeks ago, and had been facing the same problem as you. Our batch file runs Access and triggers a macro that exports some data to a text file, and works fine when run manually. However, when run through Task Scheduler, everything seemed to run fine, but the text file was never updated. After trying for weeks with no success, I finally found the reason for the problem, and a solution.
In our case, the problem was that Access 2016 wants to be run as a foreground app. But when running as a Task Scheduler app (with the "run whether user is logged on or not" option checked), it views itself as a background app and therefore won't run. See Jim Dettman's answers here for a bit more on that: https://www.experts-exchange.com/questions/28988837/
Next, I found this post by Microsoft employee Blake Morrison where he discusses the changes in the latest version of Task Scheduler. One of his troubleshooting suggestions worked for us:
Try creating a new task, but select the Configure for: option to be
“Windows Server 2003, Windows XP, or Windows 2000” – this will create
an XP/2003 fashioned task
Unfortunately you probably have to do this as a new task - existing tasks don't seem to allow you to choose this option (it didn't show up in the dropdown menu for my existing task). So my settings for the new task are:
Running as an administrator account
"Run whether user is logged on or not" - checked
"Run with highest privileges" - checked
Configure For: Windows Server 2003, Windows XP, or Windows 2000
If I manually trigger the task, I see a command prompt open, then Access briefly opens and disappears (our macro has a Quit Access command at the end), and then the command prompt disappears. Output to our text file is written as expected. If I schedule it to run while I'm logged out of the machine, obviously I see nothing, but the text file is again written as expected, so I know it worked.

Putty is not running using schedule task

I am using Putty to transfer files from my windows machine to Linux machine.
I am able to transfer, when i run the script and also if i run the same script using Schedule task with my credentials.
if schedule the task to run using system account(SYSTEM) or other user account, file transfer not happening.
Do i need to save any session vales?
PuTTY saves session information in the registry for the current user only, this information will simply be not available for the other accounts you mentioned. So you either need to provide them by exporting yours and importing them in the other user's accounts or simply provide everything needed on the shell command invoked to copy your files. The latter sounds much easier to me in combination with a little script which gets invoked by the task scheduler.

BIRT Reports - How to schedule them and send by email?

I am currently creating reports with Eclipse embedded Report Designer for BIRT reports. In my next step, I would like to schedule this reports in such a way:
It will run once per day on a set time.
It will be produced as PDF.
It will be sent by email to a concrete email address.
I am working on Windows. Is it possible to do all of that by running bash script as a scheduled task in Windows Task Scheduler?
Thanks.
You can either do this yourself with the free BIRT runtime or download the free BIRT iHub F-Type server at http://www.actuate.com/resources/product-downloads/.
How to use the BIRT runtime:
Download the BIRT runtime and install it.
http://download.eclipse.org/birt/downloads/#runtime
Test the runtime installation (if you use Windows it will look like the following)
C:\birt\ReportEngine>echo %BIRT_HOME%
C:\birt
C:\birt\ReportEngine>genReport.bat
C:\birt\ReportEngine>ECHO off
Help for ReportRunner
--mode/-m [run|render|runrender] [options] [rptdesign|rptdocument]
The default mode is runrender.
To see options for run mode, use:
--help/-h run
To see options for render mode, use:
--help/-h render
To see options for runrender mode, use:
--help/-h runrender
Print current message, use --help/-h
Test the runtime in console with a job like
C:\birt\ReportEngine>genReport.bat -o test.pdf -f PDF new_report.rptdesign
Create a batch file for your job (the sample you ran earlier).
In Windows Task Scheduler, make a task to run the batch file for your job.
Run your task on demand to make sure it runs correctly.
Windows task scheduler does have a simple email function but you will probably have to find a better program to send the generated file as email. Then add the script to run this program to your batch file. Make sure you read up on how to configure a task for Windows task scheduler correctly.
It sounds like you need a way of
running the a BIRT report, through the BIRT reporting engine,
using scheduler to control execution of the report a on a particular schedule
specifying output format
and specifying how the output should be delivered in the scheduled job.
You could role your own or you could use a Reporting/BI server that already has all of those capabilities. Depending on your other needs, this may be overkill or exactly right. I am using SpagoBI for that exact purpose. SpagoBI supports BIRT as one of the reporting formats and engines. It uses the quartz scheduler, and does support emailing a PDF version of a report to a specific email address (or list). You might also look into iHub or other products.
http://www.spagobi.org/
http://birt.actuate.com/products/birt-ihub
In SpagoBI, you would deploy your BIRT report to the SpagoBI server from SpagoBI Studio. Then, in SpagoBI Server you would setup the parameters on the report document and create a schedule for the report. On the schedule, you would specify the parameters (if other than default), a schedule, output format, and how you want the output stored/sent.