?
Solved

Scheduled Blat (mail) task does not run Windows2012

Posted on 2014-03-12
7
Medium Priority
?
4,479 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 56

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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

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 56

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

770 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