Network Files via service

I'm writing a service (in vb.net) which checks a sql database for new files, organizes those files into a tiff image, and then faxes that image. Everything works fine, except if the files in question are located at a network address. In that case, the service returns a file not found error. I have created a duplicate program as an application, and it works fine regardless of the file location. Is not being able to access files over a network a limitation of services, or do I need to do something different

Thanks


Answer this question

Network Files via service

  • Pavana

    If you're running the service under the LocalSystem account or even the NetworkService account, you will find that it can't connected to shares with ACLs that prevent Everyone from accessing the directory. This is because the service account is a local user account and doesn't have domain credentials. You should run the service as a domain account.

    Also consider that many - if not most - services do not need to run as LocalSystem - which has the same privileges as an administrator. If someone cracks your service they have complete control over the system. Instead, run as a domain account with minimal privileges and grant that domain account access to your share.

  • perfect13

    Given that your code runs correctly under your account on the desktop, but not when running as a service, this really sounds like a permission problem.  I might be able to point you to the right direction if you give a few more details.

    (a) What account are you running the service under

    (b) Are you running SQL Server remotely

    (c) What permissions are used on the remote files

    (d) Are you trying to connect via mapped drives

    Please confirm that you're running the service under an account that can access the network, and also has permissions to read files from the remote share.  This is the first big step...


  • phfjeld

    Ok, I changed the account to user, and now am able to access the files. Thanks for the help.

  • Network Files via service