Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

copying files in windows service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rprabhulingam@gmail.com - 23 Sep 2005 12:09 GMT
hai,

  i created and started a service to remote machines using vb.net.

but i cant copy a folder with files in windows service using
vb.net(remote machines) where that folder is shared in local machine.

if anyone knows plz help us..

we need urgently to complete our project..

plz repli soon.

lingam.
William DePalo [MVP VC++] - 23 Sep 2005 16:34 GMT
>   i created and started a service to remote machines using vb.net.
>
[quoted text clipped - 4 lines]
>
> we need urgently to complete our project..

Services should run under the LocalSystem account which is all powerful on
the local machine but powerless on the network. That _may_ be the reason for
the problem.

Regards,
Will
Willy Denoyette [MVP] - 23 Sep 2005 19:46 GMT
Shared resources like fileshares, are bound to a user session, that means
that the share wich is acessible by logon user A is not accessible by
another logon user.
Now, a service can run as LocalSystem , LocalService or NetworkService or as
a "domain user".
LocalSystem has no network credentials so cannot be used (well not exactly
true but...), while LocalService and NetworkService do have network access,
but they don't have a session with the remote share.
Basically, have two options to solve this issue:
1. You run your service with domain account credentials, or
2. You create a new logon session (calling LogonUser) and you establish a
network connection from within your service for that logon session (shelling
out a net use command, or by calling NetUseAdd.
Both methods have their own problems, the first requires the domain accout
to have access to the local filesystem.
The second needs a lot of PInvoke calls.

Another solution requires you to be a member of an AD domain realm (W2K or
higher Domain), in such environment all service accounts (LocalSystem,
LocalService and NetworkService) are using the "machine" acount credentials
when accessing remote resources, so all you need to do is grant the "machine
account access rights to the remote share.
Say you have a machine named "Billy" and a resource server named "Bob" in a
W2K domain "BobsDomain", and a service running as NetworkService on "Billy"
want's to copy files to "Bob". What you should do is gran BobsDomain\billy$
access to the share exported by "Bob".

Willy.

> hai,
>
[quoted text clipped - 10 lines]
>
> lingam.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.