Link to home
Start Free TrialLog in
Avatar of cdblind
cdblindFlag for Australia

asked on

server 2008 Task Scheduler

I am trying to setup task scheduler in win 2008 x64 to send an email  when an event happens.

I have 2 servers:
server 1 is SBS 2003 FQDN SBS2003.XXXX.local

Server2 is win 2008 std x64. It is running application. has been up for 4 months working fine on the networ. I want to set task scheduler to send an email when a system event occurs.
Set From: administrator@XXXX.local
Set to: me@XXXX.local
Set Subject: Test
Set Message: Test
Set SMTP server: SBS2003.XXXX.local

I get the following error:
Error --- Action Failed --- Run Failure

Task Scheduler failed to complete task "\Event Viewer Tasks\DailyBackupReport" , instance "{452890ba-8564-46cb-80bd-bd85547eb088}" , action "!!server2 Backup Report!!" . Additional Data: Error Value: 2147746323.

Full message:
- System

  - Provider

   [ Name]  Microsoft-Windows-TaskScheduler
   [ Guid]  {de7b24ea-73c8-4a09-985d-5bdadcfa9017}
 
   EventID 202
 
   Version 0
 
   Level 2
 
   Task 202
 
   Opcode 102
 
   Keywords 0x8000000000000000
 
  - TimeCreated

   [ SystemTime]  2009-06-09T09:44:35.998Z
 
   EventRecordID 42998
 
  - Correlation

   [ ActivityID]  {452890BA-8564-46CB-80BD-BD85547EB088}
 
  - Execution

   [ ProcessID]  3032
   [ ThreadID]  3524
 
   Channel Microsoft-Windows-TaskScheduler/Operational
 
   Computer SERVER2.XXXX.local
 
  - Security

   [ UserID]  S-1-5-21-4269524916-2243829543-3314361022-500
 

- EventData

  TaskName \Event Viewer Tasks\DailyBackupReport
  TaskInstanceId {452890BA-8564-46CB-80BD-BD85547EB088}
  ActionName !!Server2 Backup Report!!
  ResultCode 2147746323

Can anyone help this is sending me mental. I have a suspican it is a authority iss but this does not make sence, as I can Telnet and send email from server2.
Avatar of Glen Knight
Glen Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

OK, I have just tried this on my Windows 2008 box and with a bit of fiddling I got it working.

Just to double check everything can you set the smtp server to be the external SMTP server that your SBS server uses to send e-mail?
Also can you use your external e-mail addresses rather than your UPN?
Avatar of cdblind

ASKER

I tried both of your suggestions and I get the same error, the error value changes as I change the SMTP server, email addresses etc but that is all.

I am stumped, I spent all day Sunday from 11am until 9pm testing it on the server. Other than the error I get from task manager I can't find anyother error output to give me an indication of the problem.

I am not sure what else to try
OK, this is how I have it setup:

On the general tab:
Select run whether use is logged on or not
check run with highest privileges
I have also changed the user to the domain administrator

On the triggers tab:
I have created a basic trigger monitoring the Application log for Source WINWORD and Event ID 999
Everything else is default

On the actions tab:
Created a send an e-mail action
with
from: administrator@externalemail.co.uk
to: myemail@externalemail.co.uk
subject: Event
Text: Event
SMTP: external smtp server

I have not changed anything else

When I click OK it prompts me for a username and password for which I enter DOMAIN\Administrator and then the password.

I then in a Command Shell type the following:

eventcreate /T ERROR /ID 999 /L APPLICATION /SO WINWORD /D "Event 999 Created for testing alert"

a few seconds later a receive an e-mail.

Are you able to create a new task with the above?




Avatar of cdblind

ASKER

I think there is something wrong with my setup as I tried the above and still could not get it working. Is there a service that this would depend?

Appreciate your help
Are you getting any different error messages?
Avatar of cdblind

ASKER

no but it does seem to be an authentication error. there are some login failed messages on the smtp server. I changed server2 to being trusted on server1 (the SBS 2003 server) and this made no difference. I am using domain administrator credencials and this is not helping for the task. I am wondering if I have to use a local account on server2 and this needs to have an account in the smtp server.
Avatar of cdblind

ASKER

I get this message in the SBS servers performance report. I have not idea if it is related as I do not know what it means.

An unexpected error is forcing EXPS to close the SMTP connection to "SERVER2". "CSessionContext::OnEXPSInNegotiate" called "HrCheckClientPermissions" which failed with error code 0x8009030c ( f:\tisp1\transmt\src\smtpsink\exps\expslib\context.cpp@1819 ).
Can you try it using your external smarthost as the SMTP server?
On SBS if you open the exchange system manager and select the properties of the Internet connector it should tell you what this is.
Avatar of cdblind

ASKER

tried using the smart host and I get the same result. The only thing that changes when I change the SMTP server is the value of the "Additional Data: Error Value: 2147746321".
Avatar of cdblind

ASKER

what method does task scheduler use to send email. Do I need telnet installed and running, do you think?
No, I am looking further into this for you as I have a basic install of 2008 and it worked without too much fiddling.
Avatar of cdblind

ASKER

this may help, the server is pretty much bare it running Hyper-v so I only have Hyper-v, file services (File Server) and bare minimum of IIS installed.
Avatar of cdblind

ASKER

I decided to see if it was me being dumb or it was my setup. I setup win2008 x32 VM to replicate the error and it does exactly the same. The only difference being one is 64bit and the test system in 32bit.
OK, mine doesn't have IIS installed let me try that and see what happens
OK, I have tried it now on a Windows 2008 machine with IIS installed and also another Windows 2008 machine with Hyper-V installed.  Followed the steps in my previous post on both machines and it went through a treat.

And both times it failed to send using an internal smtp server but did work using our external smarthost.

Do you have some security software installed on the machine/network that might be preventing this?
Avatar of cdblind

ASKER

Yes I am using Trendmicro Worry Free Business Security on all Servers.

I gave up trying to use the exchange server on SBS 2003 direct or using an external SMTP server. I decided to setup SMTP sever on the Server 2008 box, I set it to relay to the SMTP on SBS 2003 box and it works. I did not what to install any thing extra on the Server 2008 host box as the Kiss priciple is best, but I have to take my medicine and work around the issue.

The external SMTP problem may be as you say it could be my security settings and the netwok routing, as there are a couple of firewall applicances between Server 2008 box and the internet.

I am stumped as to why I can telnet and connect to SBS 2003 box from Server 2008 box, and send mail. But can't use the SMTP srver directly from Server 2008 box through task scheduler.

 I really appreciate your help!
Avatar of cdblind

ASKER

Just to let you know the point behind all this.

I have setup a couple of scripts to backup a single volume that contains my VM. So that that backup can be run on a schedule Mon to Friday and backup to a network share, and not using the WB scheduler and backing up to a dedicated disk every day like Microsoft wants.

But I needed to get a report emailed to me that the backup work.

All is good now, I have a script that exports and save the Event  Backup log for the last 24hr's and a task that emails the log as an attachment. Also on that lets me know of a failure and a successful back up.

It is a shame Server 2008 does not have an email system report like SBS 2003 and a more flexable backup solution without having to write scripts to do it.
Windows Server is a completely different beast to Small Business Server.
SBS is generally a lot more user friendly because it is designed for smaller businesses that may not have their own IT Support and is therefore a lot more wizard driven.

I have tried numerous configurations and cannot get mine to work directly with the exchange server either, I have even taken the relay restrictions completely off the exchange server.
Avatar of cdblind

ASKER

I new to Exchange Experts do I just close the question and leave it as a Microsoft mystery?

I am only a would be IT, because our company is not big enough to have a dedicated IT person. Over all I do like server 2008 but there could be a couple of  refinements, that would make life a little easier.
ASKER CERTIFIED SOLUTION
Avatar of Glen Knight
Glen Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cdblind

ASKER

great help thanks
Avatar of InfomaxSolutions
InfomaxSolutions

I still don't see a solution for this problem here. I have the same exact error message when trying to send an email notification through Task Scheduler. Any help would be appreciated.
Avatar of cdblind

ASKER

I had it woking but it stoped about a month and ahalf ago and I have not had time to work out why. Nothing on the server has changed other than some MS udates, so MS probably broke it for me like they do everything.

When I get a chance to look at, if I am able fix it I will post back here.
I Have been able to get this to work on my 2008 Server Standard R2 with no problems.     I cant however get it to work on my Hyper-V Server.  I an launch scripts and batch files on-event, but I cant get Hyper-V to send an email on event.   It gives a error of "Class Not Registered" (0x80040154).   I am trying to figure out if this option is not available in Hyper-V or what.   Just to be clear.... Hyper V is running on a free version of 2008 Server Core.
Avatar of cdblind

ASKER

This seem to be very hit and miss.  I have a win 2008 server running hyper-v, I had the email task working on the hyper-v server and the vm. But now neither of them work and have been unable to figure out why since August last year. It is very frustrating. If you find a solution it would be appreciated.
I ran into this same problem, and I discovered the solution for sending emails to a local exchange server, when not on SBS is to use the ip address of the exchange and not the host name.
I have been struggling with this for a few days now but I finally got it to work. This is what I did.

This is for a Exchange Server 2010 in an AD environment.

I needed to add a Receive Connector to my Exchange Server 2010 Hub Transport. This connector will listen and receive any e-mails coming from a local IP address range I select. I followed these instructions: Allow Anonymous Relay on a Receive Connector. Don't forget to run the PowerShell command they give you.

This is now working for me and thought I would share. I hope it helps someone.

Good Luck.
Make sure you are not nesting the email task inside another task.  I was having this problem but it went away as soon as I created a task just for the email.  You also have to make sure you have telnet enabled on the Exchange server, so it can receive the mail.
Avatar of cdblind

ASKER

I have recently had cause to revist this issue, and I seemed to have found a resolution.

You need to istall the SMTP server on the win 2008 server. You then need to configure the SMTP server to act as a relay for the server you want to send email from task manager for.

e.g.
If the server you are trying to send emails from task manager is 10.0.0.1, install the SMTP then configure the SMTP server as a relay for 10.0.0.1 - by this I mean add 10.0.0.1 to the allowed relays on the SMTP server.

You can also use the SMTP server on 10.0.0.1 to send email for task manager on other win 2008 servers by adding them to the allowed relay list on the SMTP server.

This is working for me now.