I am upgrading one Console Application which is Read Outlook Public Folder. It's working fine when I run manually. But throws exception when run through IBM Tivoli Workload Scheduler.
So tried to give inbox folder name instead of public folder name. Then it's working fine in Scheduler also. So only I get below error while try to read public folder alone
Error in IMAPISession::OpenMsgStore: MAPI_E_FAILONEPROVIDER ulVersion: 0 Error: The attempt to log on to Microsoft Exchange has failed. Component: Microsoft Exchange Information Store ulLowLevelError: 1144 ulContext: 1298
var session = new RDOSession();
session.Logon(string.Empty, string.Empty, false, true, null, null);
session.Stores.FindExchangePublicFoldersStore();
var publicFolder = session.GetFolderFromPath(folderPath);
Public folder:
\\Public Folders - [email protected]\All Public Folders\XXX Folders\YYY/Object & Data\ZZZ\
- Not working
Inbox folder:
\\[email protected]\Inbox
- Working
Edit: Added log and find out Exchange connection mode changing
Manual Run ExchangeConnectionMode:
olCachedConnectedFull
Scheduler Run ExchangeConnectionMode:
olOnline
Note: We are using Redemption.dll - 5.10
Update: Old server Using Redemption.dll - 5.2 and Outlook 2003 with Exchange Server 2010. It's working fine with TWS also. New server Using Redemption.dll - 5.10 and Outlook 2016 with Exchange Server 2010. But doesn't work with TWS.
For this issue fix we need to do two things: