DCOM errors while running as domain user - scheduled task

G

Guest

Hi guys,

I'm having a bit of a problem getting a VB .NET console app to run happily
as a scheduled task. The app itself generates a bunch of word documents on a
file share on another server by reading from a template file and inserting
text at bookmark locations (with details pulled from a table in the
database). I'm running the app under a regular domain account that isn't an
administrator on the server. The read/execute permissions are set on the
console app/directory just fine, and likewise for the export folder on the
file share on the other server.

Firstly, here's a bit of background on the problem and what I've tried so
far:

- Running the console app from a command prompt (logged in as the user with
a Start -> Run -> runas /user:DOMAIN\username cmd) results in the
application running just fine. It writes the files out to the share no
problems at all.
- Running the console app as a scheduled task (with the correct domain user
profile details) results in an "0xe0434f4d" error showing up in the task
scheduler, and the following error in the System event log (Event ID 10003):

Access denied attempting to launch a DCOM Server. The server is:
{000209FF-0000-0000-C000-000000000046}
The user is <username>/<domain>, SID=S-1-5-<etc...>

After this we edited the DCOM permissions by doing the following:

* Start -> Run -> dcomcnfg.exe
* Expand "Component Services"
* Expand "Computers"
* Right-click "My Computer" -> Properties
* Default COM security tab
* Edit both "Access Permissions" and "Launch Permissions", adding in the
user running the scheduled task in both sections.

This got rid of that DCOM error, and the scheduled task attempted to run.
Unfortunately now I faced a new error when the app tries to access the Word
object. The code in question is:

Dim objWord As New Microsoft.Office.Interop.Word.Application
objWord.DisplayAlerts = WdAlertLevel.wdAlertsNone
objWord.Documents.Add() <------ Exception thrown on this line

The exception message is:

There is insufficient memory. Save the document now.

at Microsoft.Office.Interop.Word.Documents.Add(Object& Template, Object&
NewTemplate, Object& DocumentType, Object& Visible)
at AutomatedRetryLetters.AutomatedRetryLetters.Main() in
AutomatedRetryLetters.vb:line 52

Needless to say, there's plenty of available memory. Also, if I add the
domain user as a local administrator on the machine it works without a
problem.

Does anyone have any suggestions as to what I could do next? I'm not keen on
leaving this account as an administrator on the box as it has no real need.
 
K

keith moran

did you ever figure this one out on your own? I am having a very similar
problem and cannot find any help on the issue anywhere. Thanks.
 
G

Guest

The original post was actually made on my behalf, and no...no solution thus
far I'm afraid. Still running under a local admin account to keep it working
unfortunately.

- James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top