Networking Forums

Networking Forums > Computer Networking > Windows Networking > Error 1312 when Mapping drives.

Reply
Thread Tools Display Modes

Error 1312 when Mapping drives.

 
 
Tomas Vera
Guest
Posts: n/a

 
      05-21-2006, 10:36 PM
Hello All,

I have a web application that is required to copy a file from the
WebServer to a remote web server (staging server to production
server).

I've created an application that maps the network drive, then moves a
specified file to the remote server. I've imported the SDK API
"WNetAddConnection2A" to map the network drive.

This work perfectly when I'm "Remoted" in to the staging server and
call my app from the command line. But my transfer app fails when
called from the Web App.

In my web app, I've tried creating a Process to start my app, and I've
tried importing my app directly into the web app and mapping the drive
directly from the web app.

In both cases, I'm getting a '1312' error ("A specified logon session
does not exist. It may already have been terminated.").

I need help in
1. Understanding what this error means,
2. Coming up with a solution to this issue.

Background:
This is a a C# app.
The command line app simply takes a filename as a parameter. A network
drive is mapped and the file is copied to the production server,
placed in the same locaton as the source file.

The command-line app uses a config file to read the remote server path
to be mapped, the desired drive letter, a username/password valid on
the remote machine). So the same values are used in the command line
app as in the we app.

Again, this works from the command line, but not from a web app.

I suspect that this is because the command line version is called when
I am logged in to the staging server as 'user' while the web app is
running as 'aspnet'. But I don't understand what the differece is
since the app is passing the username/password to the production
server when trying to map the drive.

All help is appreciated (greatly).

-tomas
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
 
Reply With Quote
 
 
 
 
Robert L [MS-MVP]
Guest
Posts: n/a

 
      05-22-2006, 05:18 AM
try to use domainname\username to mp. this link may help,

System Errors System error 1311 - There are currently no logon servers available to service the logon request System error 1312 has occurred - - A specified logon session ...
www.chicagotech.net/systemerrors.htm


Bob Lin, MS-MVP, MCSE & CNE
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on http://www.HowToNetworking.com
"Tomas Vera" <tavera@NO_SPAM_sbcglobal.net> wrote in message news:(E-Mail Removed)...
Hello All,

I have a web application that is required to copy a file from the
WebServer to a remote web server (staging server to production
server).

I've created an application that maps the network drive, then moves a
specified file to the remote server. I've imported the SDK API
"WNetAddConnection2A" to map the network drive.

This work perfectly when I'm "Remoted" in to the staging server and
call my app from the command line. But my transfer app fails when
called from the Web App.

In my web app, I've tried creating a Process to start my app, and I've
tried importing my app directly into the web app and mapping the drive
directly from the web app.

In both cases, I'm getting a '1312' error ("A specified logon session
does not exist. It may already have been terminated.").

I need help in
1. Understanding what this error means,
2. Coming up with a solution to this issue.

Background:
This is a a C# app.
The command line app simply takes a filename as a parameter. A network
drive is mapped and the file is copied to the production server,
placed in the same locaton as the source file.

The command-line app uses a config file to read the remote server path
to be mapped, the desired drive letter, a username/password valid on
the remote machine). So the same values are used in the command line
app as in the we app.

Again, this works from the command line, but not from a web app.

I suspect that this is because the command line version is called when
I am logged in to the staging server as 'user' while the web app is
running as 'aspnet'. But I don't understand what the differece is
since the app is passing the username/password to the production
server when trying to map the drive.

All help is appreciated (greatly).

-tomas
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a

 
      05-22-2006, 09:39 AM
You need to impersonate, aspnet is a local account which cannot be used to
access remote resources.
Please search "How To: Use Impersonation and Delegation in ASP.NET 2.0"
in msdn for more details.

Willy.

"Tomas Vera" <tavera@NO_SPAM_sbcglobal.net> wrote in message
news:(E-Mail Removed)...
| Hello All,
|
| I have a web application that is required to copy a file from the
| WebServer to a remote web server (staging server to production
| server).
|
| I've created an application that maps the network drive, then moves a
| specified file to the remote server. I've imported the SDK API
| "WNetAddConnection2A" to map the network drive.
|
| This work perfectly when I'm "Remoted" in to the staging server and
| call my app from the command line. But my transfer app fails when
| called from the Web App.
|
| In my web app, I've tried creating a Process to start my app, and I've
| tried importing my app directly into the web app and mapping the drive
| directly from the web app.
|
| In both cases, I'm getting a '1312' error ("A specified logon session
| does not exist. It may already have been terminated.").
|
| I need help in
| 1. Understanding what this error means,
| 2. Coming up with a solution to this issue.
|
| Background:
| This is a a C# app.
| The command line app simply takes a filename as a parameter. A network
| drive is mapped and the file is copied to the production server,
| placed in the same locaton as the source file.
|
| The command-line app uses a config file to read the remote server path
| to be mapped, the desired drive letter, a username/password valid on
| the remote machine). So the same values are used in the command line
| app as in the we app.
|
| Again, this works from the command line, but not from a web app.
|
| I suspect that this is because the command line version is called when
| I am logged in to the staging server as 'user' while the web app is
| running as 'aspnet'. But I don't understand what the differece is
| since the app is passing the username/password to the production
| server when trying to map the drive.
|
| All help is appreciated (greatly).
|
| -tomas
| /*-------------------------------
| * Tomas Vera
| * tomas (at) sbcglobal (dot) net
| *-------------------------------
| */


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
Mapping Drives Joe Windows Networking 2 09-28-2004 02:42 PM
Mapping network drives Hal Windows Networking 4 04-19-2004 03:26 PM
Mapping Drives David Otley Windows Networking 0 12-09-2003 06:25 PM
mapping drives John Martin Windows Networking 0 09-03-2003 02:57 PM
mapping drives Drew Windows Networking 0 07-09-2003 03:26 PM



1 2 3 4 5 6 7 8 9 10 11