Solved

acess share folder, getting error, but why???

Posted on 2002-06-20
4
265 Views
Last Modified: 2013-11-20
I am using WNetAddConnection2 function to access share folder. Everything works fine if I use it through an application, but when I use same code from a windows service then I get this error. What could be the reason.

error number 1219 (The credentials supplied conflict with an existing set of credentials).

plz HELP me.
0
Comment
Question by:haider
  • 2
4 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 7098348
Hi,

You get this message when another connection exists already (or still) between your computer and the one you try to connect with (i.e. accessing a shared folder) but with a different name-password pair.

So, try to determine who's connected to that computer.
On WinNT for example choose "Server" in the control panel and then click the "Users" button.

I expect you to see a connection you weren't aware of.

Bye.
0
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 7098519
You cannot access *any* network functions from a service when this service is set to run under LocalSystem. To overcome this, make sure to assign your service to run under a predefined user account (preferrably one belonging to the admin group) which does have network access (this is usually done by specifying an account name&password in the call to 'CreateService()', but you're also able to change this from the 'services' control panel applet).
0
 

Author Comment

by:haider
ID: 7112964
I am using smae technique and passing user name and password in "CreateService", but I am getting error in system log. Error is "Logon failure: the user has not been granted the requested logon type at this computer.". I am using administrator account user name and password. What could be the reason???
0
 
LVL 86

Expert Comment

by:jkr
ID: 7113839
>>What could be the reason???

You have to assign the 'Logon as a service' provilege to the account you are using. If you are using NT, you can do that using the user manager, on W2k, the 'Local Security Policy' MMC will allow you to do that (execute "mmc secpol.msc /s" on the command line)
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 54
twoTwo  challenge 35 108
sumHeights2  challenge 7 117
Trying to run powershell  in a batch file. How do I do this? 8 107
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question