1

Topic: Connection with a network share

Kind time of days.
Help with a solution of a problem.
There is server S1 on which the folder with files is twisted MSSQL2000 and . There is an application on client 1 which is connected to  and should connect to a full-sphere as a local disk for operation with files. 1 is in the domain. By operation of application from under a profile, all is normal. By application operation as the resource like connects services (connection transits without an error) but a contained resource does not see.  to a resource I do by means of WNetAddConnection2 (NR, nil, nil, 0). If at connection to a resource to use authorization produces an error that plural connection to the server or a resource of one  under several names "is not authorized",  before it to 1 connection to a DB under a domain name is already produced

2

Re: Connection with a network share

zsv wrote:

but a contained resource does not see.

Translate. And it is better - quote the original error report without .

3

Re: Connection with a network share

zsv wrote:

By application operation as the resource like connects services (connection transits without an error) but a contained resource does not see.  to a resource I do by means of WNetAddConnection2 (NR, nil, nil, 0). If at connection to a resource to use authorization produces an error that plural connection to the server or a resource of one  under several names "is not authorized",  before it to 1 connection to a DB under a domain name

is already produced
There all is much more difficult. All network connections are isolated in a session of the current user. Therefore, if you from service want to connect a network drive for the user it is necessary to launch this connection in separate process which is fulfilled on behalf of the given user. here on SO a similar question, only for C#, and in the same place pair of variants of its decision.
One more variant: from service to create the job for the scheduler which at an input of the user will connect to it this disk through net use...

4

Re: Connection with a network share

Dimitry Sibiryakov wrote:

it is passed...
Translate. And it is better - quote the original error report without .

There there is no error because service this resource successfully connects. Only the user does not see its (connection), in any way. The exception - if service is fulfilled on behalf of this user.

5

Re: Connection with a network share

I will deliver that at it the service is launched from Local System, at which more likely
The rights to a network are not present generally.

6

Re: Connection with a network share

Dimitry Sibiryakov;
On FindFirst (dir+s, $27, FileAttr); after connection produces an error 5 "it is refused access"

7

Re: Connection with a network share

I do not need to be connected from service "for the user". The service connects a network share for the use

8

Re: Connection with a network share

Dimitry Sibiryakov;
Probably, and that it is necessary to make, that  to see files on a resource. And why then  the resource is connected?

9

Re: Connection with a network share

zsv wrote:

and that it is necessary to make, that  to see files on a resource.

Or to launch service on behalf of the correct user or to specify this user
By call WNetAddConnection.

10

Re: Connection with a network share

Dimitry Sibiryakov;
>> Or to launch service on behalf of the correct user
Here it I will try
>> to specify this user by call WNetAddConnection.
So it is impossible, because "plural connection", because of that that before it already  connection to  under a domain name does not allow to be connected with an error

11

Re: Connection with a network share

While all thanks, I will try in new year. All happy New Year and successful development smile

12

Re: Connection with a network share

Dimitry Sibiryakov wrote:

I will deliver that at it the service is launched from Local System, at which more likely
The rights to a network are not present generally.

Through WMNetAddConnection2 () it at all has no value if there at connection to specify user name and the password it all perfectly sees.

13

Re: Connection with a network share

Besides network troubles, there can be still troubles with the rights at level : 1 has access as enters into group "users of the domain", and "Visitor" or no All"access have.