locked
Network Service: Access Denied RRS feed

  • Question

  • I am creating a windows service that runs on a specific computer and accesses a database on a fileshare. So far I have been getting "Path is invalid" errors from OleDb and I just discovered that this error should be fixed if I upgrade to a Network Service in what the service declares itself as. However, when I try to start the service it gives me an access denied error.

    I am operating on a computer on a corperate network where I am an administrator on this particular computer, but not a network administrator. I think this may be causing this problem. I personally have access to the fileshare that the database is on, but the service does not. Is there some way to circumvent this need to be a network administrator to run the service?

    Also, if I got a network administrator to start the service once would it continue functioning even after the administrator had logged off and the computer was restarted? This would be an acceptable compromise.

    I am using MSVC# 2008 Express.
    Wednesday, May 6, 2009 9:51 PM

Answers

  • Try running it as Local System instead of under the network account.  Also, if you want to run it using your credentials, you'll have to specify that in computer management under Services, viewing the properties for your specific service.
    David Morton - http://blog.davemorton.net/
    • Marked as answer by Los Frijoles Thursday, May 7, 2009 1:01 PM
    Wednesday, May 6, 2009 10:01 PM
  • I did that and I removed the reference to a mapped network drive (used the absolute path..the //server/folder one). Now it works. Thanks.
    • Marked as answer by Los Frijoles Thursday, May 7, 2009 1:01 PM
    Thursday, May 7, 2009 1:01 PM

All replies

  • Try running it as Local System instead of under the network account.  Also, if you want to run it using your credentials, you'll have to specify that in computer management under Services, viewing the properties for your specific service.
    David Morton - http://blog.davemorton.net/
    • Marked as answer by Los Frijoles Thursday, May 7, 2009 1:01 PM
    Wednesday, May 6, 2009 10:01 PM
  • I did that and I removed the reference to a mapped network drive (used the absolute path..the //server/folder one). Now it works. Thanks.
    • Marked as answer by Los Frijoles Thursday, May 7, 2009 1:01 PM
    Thursday, May 7, 2009 1:01 PM