By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,077 Members | 2,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,077 IT Pros & Developers. It's quick & easy.

W2K3 Service w/ UNC Access, Local Disk Access, and DB Access

P: n/a
Rob
Hi,

I am working on a project that requires a Windows Service which
performs the following file transfer functions.

1. It monitors a specific local directory on a Windows 2003 Server.
2. When it finds files with a specific extension, it queries a SQL
Server database to determine what workstation will be the destination
of a File.Copy.
3. It copies those files to the appropriate workstations on the LAN,
using the File.Copy command.

The network does not have a domain controller. The server is a
standard Windows 2003 Server, which runs IIS and MSDE, servicing a web
application. This web application creates files in a configurable
location on the server, which have to be moved to workstations on the
network, in order to free up the space on disk.

These files are backed up from the workstations with BackupExec
nightly.

Here are my problems.

1. When I configure the Windows Service as Local System, it does not
have access to mapped drives or UNCs.
2. When I configure the Windows Service as Network Service, it does
not have access to local files. I haven't gotten far enough to
determine if it has access to SQL Server.
3. When I configure the Windows Service as a User, with a local user
account, it doesn't install, even if I configure the local user with
"logon as service" permissions.
4. I do not have a domain controller in this small office, so I cannot
configure this service with a domain user.

When I build the application as a Windows application, it works.

So what do I need to do to make a Windows Service have local disk
access, database access, and UNC access to public shares on the LAN?

Thanks.
Nov 16 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
nal
Run it under the context of a user that has appropriate ACLs on the file
system. This same user can be given appropriate db permissions.
"Rob" <rm*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
Hi,

I am working on a project that requires a Windows Service which
performs the following file transfer functions.

1. It monitors a specific local directory on a Windows 2003 Server.
2. When it finds files with a specific extension, it queries a SQL
Server database to determine what workstation will be the destination
of a File.Copy.
3. It copies those files to the appropriate workstations on the LAN,
using the File.Copy command.

The network does not have a domain controller. The server is a
standard Windows 2003 Server, which runs IIS and MSDE, servicing a web
application. This web application creates files in a configurable
location on the server, which have to be moved to workstations on the
network, in order to free up the space on disk.

These files are backed up from the workstations with BackupExec
nightly.

Here are my problems.

1. When I configure the Windows Service as Local System, it does not
have access to mapped drives or UNCs.
2. When I configure the Windows Service as Network Service, it does
not have access to local files. I haven't gotten far enough to
determine if it has access to SQL Server.
3. When I configure the Windows Service as a User, with a local user
account, it doesn't install, even if I configure the local user with
"logon as service" permissions.
4. I do not have a domain controller in this small office, so I cannot
configure this service with a domain user.

When I build the application as a Windows application, it works.

So what do I need to do to make a Windows Service have local disk
access, database access, and UNC access to public shares on the LAN?

Thanks.

Nov 16 '05 #2

P: n/a
Rob
"nal" <nal@invalidaddress> wrote in message news:<um**************@TK2MSFTNGP09.phx.gbl>...
Run it under the context of a user that has appropriate ACLs on the file
system. This same user can be given appropriate db permissions.
"Rob" <rm*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
Hi,

I am working on a project that requires a Windows Service which
performs the following file transfer functions.

1. It monitors a specific local directory on a Windows 2003 Server.
2. When it finds files with a specific extension, it queries a SQL
Server database to determine what workstation will be the destination
of a File.Copy.
3. It copies those files to the appropriate workstations on the LAN,
using the File.Copy command.

The network does not have a domain controller. The server is a
standard Windows 2003 Server, which runs IIS and MSDE, servicing a web
application. This web application creates files in a configurable
location on the server, which have to be moved to workstations on the
network, in order to free up the space on disk.

These files are backed up from the workstations with BackupExec
nightly.

Here are my problems.

1. When I configure the Windows Service as Local System, it does not
have access to mapped drives or UNCs.
2. When I configure the Windows Service as Network Service, it does
not have access to local files. I haven't gotten far enough to
determine if it has access to SQL Server.
3. When I configure the Windows Service as a User, with a local user
account, it doesn't install, even if I configure the local user with
"logon as service" permissions.
4. I do not have a domain controller in this small office, so I cannot
configure this service with a domain user.

When I build the application as a Windows application, it works.

So what do I need to do to make a Windows Service have local disk
access, database access, and UNC access to public shares on the LAN?

Thanks.


Thanks for your response. I've already tried this, but the local user
setting causes the installation to fail, even when I set the "Logon as
Service" permission for the local user.
Nov 16 '05 #3

P: n/a
It should not fail, how did you specify your local account?
Willy.

"Rob" <rm*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
"nal" <nal@invalidaddress> wrote in message
news:<um**************@TK2MSFTNGP09.phx.gbl>...
Run it under the context of a user that has appropriate ACLs on the file
system. This same user can be given appropriate db permissions.
"Rob" <rm*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
> Hi,
>
> I am working on a project that requires a Windows Service which
> performs the following file transfer functions.
>
> 1. It monitors a specific local directory on a Windows 2003 Server.
> 2. When it finds files with a specific extension, it queries a SQL
> Server database to determine what workstation will be the destination
> of a File.Copy.
> 3. It copies those files to the appropriate workstations on the LAN,
> using the File.Copy command.
>
> The network does not have a domain controller. The server is a
> standard Windows 2003 Server, which runs IIS and MSDE, servicing a web
> application. This web application creates files in a configurable
> location on the server, which have to be moved to workstations on the
> network, in order to free up the space on disk.
>
> These files are backed up from the workstations with BackupExec
> nightly.
>
> Here are my problems.
>
> 1. When I configure the Windows Service as Local System, it does not
> have access to mapped drives or UNCs.
> 2. When I configure the Windows Service as Network Service, it does
> not have access to local files. I haven't gotten far enough to
> determine if it has access to SQL Server.
> 3. When I configure the Windows Service as a User, with a local user
> account, it doesn't install, even if I configure the local user with
> "logon as service" permissions.
> 4. I do not have a domain controller in this small office, so I cannot
> configure this service with a domain user.
>
> When I build the application as a Windows application, it works.
>
> So what do I need to do to make a Windows Service have local disk
> access, database access, and UNC access to public shares on the LAN?
>
> Thanks.


Thanks for your response. I've already tried this, but the local user
setting causes the installation to fail, even when I set the "Logon as
Service" permission for the local user.

Nov 16 '05 #4

P: n/a
Rob
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message news:<OQ**************@tk2msftngp13.phx.gbl>...
It should not fail, how did you specify your local account?
Willy.

"Rob" <rm*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
"nal" <nal@invalidaddress> wrote in message
news:<um**************@TK2MSFTNGP09.phx.gbl>...
Run it under the context of a user that has appropriate ACLs on the file
system. This same user can be given appropriate db permissions.
"Rob" <rm*******@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
> Hi,
>
> I am working on a project that requires a Windows Service which
> performs the following file transfer functions.
>
> 1. It monitors a specific local directory on a Windows 2003 Server.
> 2. When it finds files with a specific extension, it queries a SQL
> Server database to determine what workstation will be the destination
> of a File.Copy.
> 3. It copies those files to the appropriate workstations on the LAN,
> using the File.Copy command.
>
> The network does not have a domain controller. The server is a
> standard Windows 2003 Server, which runs IIS and MSDE, servicing a web
> application. This web application creates files in a configurable
> location on the server, which have to be moved to workstations on the
> network, in order to free up the space on disk.
>
> These files are backed up from the workstations with BackupExec
> nightly.
>
> Here are my problems.
>
> 1. When I configure the Windows Service as Local System, it does not
> have access to mapped drives or UNCs.
> 2. When I configure the Windows Service as Network Service, it does
> not have access to local files. I haven't gotten far enough to
> determine if it has access to SQL Server.
> 3. When I configure the Windows Service as a User, with a local user
> account, it doesn't install, even if I configure the local user with
> "logon as service" permissions.
> 4. I do not have a domain controller in this small office, so I cannot
> configure this service with a domain user.
>
> When I build the application as a Windows application, it works.
>
> So what do I need to do to make a Windows Service have local disk
> access, database access, and UNC access to public shares on the LAN?
>
> Thanks.


Thanks for your response. I've already tried this, but the local user
setting causes the installation to fail, even when I set the "Logon as
Service" permission for the local user.


I go to Computer Management/Local Users and Groups. I create a Local
User. I assigned the user to the Administrators group. Then I go to
Local Security Policy, and assign that user the "Logon as Service"
permission.

Then I build the windows service with User access specified, and I put
the user's account name and password in the code. Then I rebuild the
deployment application. I've tried putting the user's name in the code
in the following ways to no avail.

username password
computer\\username password
..\\username password

When I run it, I get the user permissions error, and the installation
fails.

The network on which I'm testing has a domain controller. However, I
cannot rely on this because the network where the application will be
installed has no controller.

Thanks again for your responses.
Nov 16 '05 #5

P: n/a
computer\\username password


Is the correct format for the ServiceProcessInstaller.Username property.

When exactly do you get the error, when running the installutil or when
starting the service?

Willy.

Nov 16 '05 #6

P: n/a
Rob
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message news:<#H**************@TK2MSFTNGP12.phx.gbl>...
computer\\username password


Is the correct format for the ServiceProcessInstaller.Username property.

When exactly do you get the error, when running the installutil or when
starting the service?

Willy.


I see the problem. I was putting the username in the password property
and vice versa. For some reason, I assumed that the Username would be
first.

Thanks for your assistance.
Nov 16 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.