Link to home
Start Free TrialLog in
Avatar of George Perolli
George PerolliFlag for Canada

asked on

Windows 10 Scheduled Tasks

I have written a console program that scans an Exchange Public Folder Calendar for appointments.  If there are appointments within a given period of time, then it creates an email with the subject of the appointment and sends it to me.

On a Windows 8.1 machine when I run the program from a command prompt or if I create a scheduled task and run the task, the application works perfectly

On a Windows 10 machine when I run the program from a command prompt it work perfectly.  If I create a scheduled task and run the task the application fails.

In both cases I use the exact same configuration on the scheduled task and yet on the Windows 10 it does not work.
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada 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 George Perolli

ASKER

Same credentials which is a domain admin, same domain, against the same Exchange 2016 server, and on the same network.  The only differences is that 1 client is Windows 8.1 Hyper-V VM and the other is physical PC Windows 10.
you will need to add tracing and error logging to your application to find out where and the exception raised when your app is running from the scheduler.

I have many applications running from schedulers without issues. There is something else.
In my application I am using Outlook to be able to access Exchange.  Here is some of my code:

Dim objOutlook as Microsoft.Office.Intrerop.Outlook.Application  <-- This line runs properly
objOutlook = New Microsoft.Office.Interop.Outlook.Application()  <-- Program hangs on this line

I do not have the error that is thrown.  I modified my code to write to a text file after each line of code gets executed so I know what is causing the problem.  I will now get it to catch the error.
Have you tried setting "Run with highest privileges"? and "run whether user is logged on or not"?
Yes I have.
can you post a screen shot of your tasks settings here please?
I have written a console program that scans an Exchange Public Folder Calendar for appointments.  If there are appointments within a given period of time, then it creates an email with the subject of the appointment and sends it to me. WHY don't you just add that calendar to outlook ?User generated image
I do not want to add the Calendar to Outlook because I want the calendar to out live the user.  If the user leaves the company who will get the notifications?  Yes you can move the calendar to someone else, but if you forget then renewals will be missed.  

With my app the notifications can be sent to a distribution list and therefore not user specific.
ASKER CERTIFIED SOLUTION
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
Eric suggested that I find what the exact error that was being thrown.  With the exact error I was able to find an article that led me to solving my own problem.  I posted the solution that I found so that other people with the same problem have a solution.