Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to access a network share folder?

Reply
Thread Tools

How to access a network share folder?

 
 
Andrew Shitov
Guest
Posts: n/a
 
      09-13-2004
I have to copy files from one network share folder to another (both are
on different remote machines). Server running this asp.net appllication
is not configurable (except web.config), while network forlers requires
passwords.

The ideal solution would allow me to simply write File.Copy (from, to,
true).

I thought of two possibilities: either map a network folder inside the
asp.net application or connect to the server that contail share.

Trying to start 'net use' failed:

System.Diagnostics.Process.Start ("net", @"use q: \\server\share$
/user:name password");

After this I still have the same drives as before calling 'net use'.

What should I do? How to map a network drive? Or how to access a server
(not changing the machine.config)?

 
Reply With Quote
 
 
 
 
GrantMagic
Guest
Posts: n/a
 
      09-13-2004
Have you tried using impersonate in the config file to make the application
impersonate a user on the other server, there by giving you permission to
write to the share

"Andrew Shitov" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have to copy files from one network share folder to another (both are on
>different remote machines). Server running this asp.net appllication is not
>configurable (except web.config), while network forlers requires passwords.
>
> The ideal solution would allow me to simply write File.Copy (from, to,
> true).
>
> I thought of two possibilities: either map a network folder inside the
> asp.net application or connect to the server that contail share.
>
> Trying to start 'net use' failed:
>
> System.Diagnostics.Process.Start ("net", @"use q: \\server\share$
> /user:name password");
>
> After this I still have the same drives as before calling 'net use'.
>
> What should I do? How to map a network drive? Or how to access a server
> (not changing the machine.config)?
>



 
Reply With Quote
 
 
 
 
Andrew Shitov
Guest
Posts: n/a
 
      09-13-2004
> Have you tried using impersonate in the config file to make the application
> impersonate a user on the other server, there by giving you permission to
> write to the share


I inserted <identity impersonate="true"/> into web.config - but I have
to somehow pass userName/password pair. If I will place

userName="..." password="..."

into <identity impersonate/> then an application fails to start.

 
Reply With Quote
 
Andrew Shitov
Guest
Posts: n/a
 
      09-13-2004
> You need to grant asp.net account special rights to run exes. If you can't
> change anything on the server, you might want to setup remote machines that
> host shared directories to allow access to asp.net account on the web
> server.


I cannot change remote machine security settings while I am able to
congigure a machine with asp.net application. But is it possible to
aviod modifying machine.config?

How to grant asp.net account these rights?

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-13-2004
You need to grant asp.net account special rights to run exes. If you can't
change anything on the server, you might want to setup remote machines that
host shared directories to allow access to asp.net account on the web
server.

Eliyahu

"Andrew Shitov" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have to copy files from one network share folder to another (both are
> on different remote machines). Server running this asp.net appllication
> is not configurable (except web.config), while network forlers requires
> passwords.
>
> The ideal solution would allow me to simply write File.Copy (from, to,
> true).
>
> I thought of two possibilities: either map a network folder inside the
> asp.net application or connect to the server that contail share.
>
> Trying to start 'net use' failed:
>
> System.Diagnostics.Process.Start ("net", @"use q: \\server\share$
> /user:name password");
>
> After this I still have the same drives as before calling 'net use'.
>
> What should I do? How to map a network drive? Or how to access a server
> (not changing the machine.config)?
>



 
Reply With Quote
 
Andrew Shitov
Guest
Posts: n/a
 
      09-13-2004
I am able to act as an administrator of a machine with asp.net
application. Would you tell, how to do that?

> What you are able to do with your application depends on what rights the
> account your application is running under has. Granting rights to accounts
> is a job of the system administrator. He/she does it with standard Windows
> utilities. It can't be done from within the application.



>>How to grant asp.net account these rights?


 
Reply With Quote
 
GrantMagic
Guest
Posts: n/a
 
      09-13-2004
Here is exactly how i had it working in my application

<configuration>
<system.web>
<identity impersonate="true" userName="DMN\UserName"
password="password" />
</system.web>
</configuration>

"Andrew Shitov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> Have you tried using impersonate in the config file to make the
>> application impersonate a user on the other server, there by giving you
>> permission to write to the share

>
> I inserted <identity impersonate="true"/> into web.config - but I have to
> somehow pass userName/password pair. If I will place
>
> userName="..." password="..."
>
> into <identity impersonate/> then an application fails to start.
>



 
Reply With Quote
 
Andrew Shitov
Guest
Posts: n/a
 
      09-13-2004
> <configuration>
> <system.web>
> <identity impersonate="true" userName="DMN\UserName"
> password="password" />
> </system.web>
> </configuration>


In this case an application cannot even start:

Parser Error Message: Could not create Windows user token from the
credentials specified in the config file. Error from the operating
system 'Logon failure: unknown user name or bad password. '

An application need these userName/password only to access the remote
server but it tries to use them even when I open an .aspx page.

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-13-2004
What you are able to do with your application depends on what rights the
account your application is running under has. Granting rights to accounts
is a job of the system administrator. He/she does it with standard Windows
utilities. It can't be done from within the application.

Eliyahu

"Andrew Shitov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> > You need to grant asp.net account special rights to run exes. If you

can't
> > change anything on the server, you might want to setup remote machines

that
> > host shared directories to allow access to asp.net account on the web
> > server.

>
> I cannot change remote machine security settings while I am able to
> congigure a machine with asp.net application. But is it possible to
> aviod modifying machine.config?
>
> How to grant asp.net account these rights?
>



 
Reply With Quote
 
GrantMagic
Guest
Posts: n/a
 
      09-13-2004
have you tried to give the user your impersonating, rights to work on the
machine the application is running.

I.E. create a generic user for both servers, enable it admin rights on both
servers, and test if the application will start then?


"Andrew Shitov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> <configuration>
>> <system.web>
>> <identity impersonate="true" userName="DMN\UserName"
>> password="password" />
>> </system.web>
>> </configuration>

>
> In this case an application cannot even start:
>
> Parser Error Message: Could not create Windows user token from the
> credentials specified in the config file. Error from the operating system
> 'Logon failure: unknown user name or bad password. '
>
> An application need these userName/password only to access the remote
> server but it tries to use them even when I open an .aspx page.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
[ANN] clogger 0.3.2 - share a hacker, share a bug Eric Wong Ruby 0 02-13-2010 10:42 AM
question DRb class definition share or not share Jack Ruby 2 10-11-2007 05:26 PM
Can not access 1 computers share files on network =?Utf-8?B?RG91Z3lib3k=?= Wireless Networking 2 04-14-2006 03:35 AM
Wireless Network - Setup - How? See/share Files, share printers, how? Wayne Wireless Networking 2 04-08-2006 04:34 PM



Advertisments