Solved

Scheduled Blat (mail) task does not run Windows2012

Posted on 2014-03-12
7
4,195 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 54

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 84

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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 54

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 84

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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 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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

739 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