I am trying to create a service that accesses exchange information stores and checks for emails that have arrived. Everything works just fine when I run it on the command line but I get a very nice "Unspecified error" when I try to run as a service or schedule task. The error that I get is: OLE exception from "Collaboration Data Objects": [Collaboration Data Objects - [E_FAIL(80004005)]] Win32::OLE(0.1707) error 0x80004005: "Unspecified error" in METHOD/PROPERTYGET "Folders"

The error occurs after I have created the MAPI object, logged in, and retrieved both the information store and the root folder. I have done similar tasks using VB and never had any issues like this.