Solved

Scheduled Blat (mail) task does not run Windows2012

Posted on 2014-03-12
7
4,283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 55

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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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 55

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 500 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

Industry Leaders: 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!

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
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…

690 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