Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a windows service running on my local machine. It's configured to run under NT AUTHORITY\NETWORK SERVICE. The program access a network shared drive on a computer in the same subnet. That shared directory has Everyone set to Full control.

I'm getting False on File.Exists(), but the file exists. I'm certain this is a permission issue. Am I forgetting anything? Note, the computer with the shared drive is not on a domain.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

The fact that the machine with the shared drive is not on a domain is where your main problem is. In order to get this to work you will have to configure the Windows Service to run as a specific user, and then you'll have to create an identical user on the remote system with the same password. It might work then.

The problem stems from the fact that in order to log in to a machine not in a domain, you have to log into that machine using an account that exists on that machine. The machine account for something else definitely won't exist on that local machine. By creating an identical user with an identical password, you might be able get the login to work.

share|improve this answer
    
Thanks sysadmin. You are correct. Once I created an identical account on both machines, it worked. So the ideal situation would be to have the network share and the windows server (where the service is running on) to be in the same domain. Then I would create a domain user account to run the service and has access to the share. –  Brian T Sep 1 '10 at 22:01
    
Yes indeed. If they were in the same domain, you could follow tony roth's advice; set it up like you had (network service) and then grant the machine-account the rights on the remote machine. –  sysadmin1138 Sep 1 '10 at 22:06

change it to run as local system then assign the machineaccount$ to the correct permisions on the share/NTFS permissions notice the highlight on NTFS that has to be covered also.

share|improve this answer
    
darn missed the not in domain part –  tony roth Sep 2 '10 at 3:09
    
I do not understand; what name do I have to specify in the share permissions on the remote machine? –  Wilbert Jul 30 '13 at 12:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.