Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Scheduled Blat (mail) task does not run Windows2012

Posted on 2014-03-12
7
Medium Priority
?
4,897 Views
Last Modified: 2014-03-15
I have a  problem getting a scheduled task running Blat on a Windows Server 2012.

The task consists just one simple bat file with one line:

"D:\Program Files\OmniBack\bin\omnirpt" -report list_sessions -timeframe 24 24 | C:\windows\system32\blat -subject "Data Protector rapport" -to X.X@xxx.nl

The scheduling runs without any errors but no mail is send out, when running the bat file from a prompt (manual) it works fine.

I split the "problem" in two by running the command until the piping in the bat file scheduled, no problem.

When testing the bat file with only the mail command it fails to send the message out.

C:\windows\system32\blat -subject "Data Protector rapport" -to X.X@xxx.nl

While no errors appeared in logs or anywhere else I captured the output in a file by editting the line:

C:\windows\system32\blat -subject "Data Protector rapport" -to X.X@xxx.nl >> c:\scripts\output.txt

The output file now says:

Blat v3.1.1 (build : Feb 27 2013 20:04:23)
32-bit Windows, Full, Unicode

Failed to open registry key for Blat
To set the SMTP server's name/address and your username/email address for that
server machine do:
blat -install  server_name  your_email_address
or use '-server <server_name>' and '-f <your_email_address>'
aborting, nothing sent


I tried it with the /c command option in the scheduler al so.

The task is run by a domain account ,the same account is used when manualy running the batch file from a command prompt (as different user)

What goes wrong here?
0
Comment
Question by:Oldiesel
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 57

Expert Comment

by:McKnife
ID: 39923400
Hi.

Known "problem". The registry key that is mentioned is created when you first start blat. In your task, you will for sure use another account. So you will have to start blat in your command line from the same account as the task is running with!
0
 
LVL 85

Expert Comment

by:oBdA
ID: 39923417
Just do what the error message tells you to do: add '-server <server_name>' and '-f <your_email_address>' to your blat command line.
"D:\Program Files\OmniBack\bin\omnirpt" -report list_sessions -timeframe 24 24 | C:\windows\system32\blat -server your.smtp.server -f your@email.address -subject "Data Protector rapport" -to X.X@xxx.nl

Open in new window

0
 
LVL 3

Expert Comment

by:telczj9
ID: 39923433
The problem is that very first time you run it need to register with blat what will be the target mail server or SMTP server.  You also need to provide the email address that has been granted access to the mail server/SMTP server.  By default SMTP will allow any account with domain it uses.

Use syntax suggested by the output you capture.

blat -install  server_name  your_email_address

Open in new window


Cheers!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Oldiesel
ID: 39923631
Nope did not fall for that:-)

Offcourse blat has been registered, would be too easy:-)

Taken from the reg:

Windows Registry Editor Version 5.00

[HKEY_USERS\S-1-5-21-4071868041-848849937-436062856-1126\Software\Classes\
VirtualStore\MACHINE\SOFTWARE\Wow6432Node\Public Domain\Blat]
"SMTP server"="mailclustersmtp.netxxx.xxxx"
"SMTP Port"="25"
"Try"="1"
"Login"=""
"Pwd"=""
"Sender"="dataprotector@xxx.xx"


The problem does reside somewhere in the scheduling phase for sure.
When running the bat file manualy from the prompt it works fine!
0
 
LVL 57

Expert Comment

by:McKnife
ID: 39923636
You have not answered anything with that req-quotation. We don't know if S-1-5-21-4071868041-848849937-436062856-1126 is the user that you configured in the task.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 1500 total points
ID: 39923651
Please add the -server and -f options to the command line and try again. Running as a scheduled task is not the same as an interactive session.
0
 

Author Closing Comment

by:Oldiesel
ID: 39931965
Behavior of a bat or cmd script is sure different when scheduled.
When adding the -server and -f option in the commandline in the bat file it worked, when running it in a dos box it worked fine without the (extra) parameters.

The error was setting me on the wrong path, it had nothing to do with register or installing Blat as the error suggested.
1

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question