473,807 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with writing a file to a Network path (UPN)

HELP!
I know there's a lot of urls out there, please don't reply with a
link.
I have tried them all but i guess i am missing something.

I have 2 servers on the same network, my ASP.NET runs on Server1 and
need to write RSS to a Server2
Something like this:
Dim enc As Encoding = Encoding.UTF8
Dim objXMLTW As New XmlTextWriter(" \\Server2\wwwro ot\SiteRoot
\rss.xml", enc)
objXMLTW.WriteS tartDocument()
objXMLTW.WriteS tartElement("rs s")
objXMLTW.WriteE lementString("B lah", "Blah Blah Blah")
objXMLTW.WriteE ndDocument()
objXMLTW.Flush( )
objXMLTW.Close( )

I have tried:
* added <identity impersonate="tr ue"/to web.config (in Server1)
* added Full Control to Server1\ASPNET Server1\IUSR_Se rver1
Server1\IWAM_Se rver1
* created virtual directory on Server1 and tried both "Connect As"
options

I keep getting "Logon failure: unknown user name or bad password."

Ideas?
Jun 27 '08 #1
1 1389
re:
!* added <identity impersonate="tr ue"/to web.config (in Server1)

That's not enough.

You need to give write permissions to the account ASP.NET is running as,
so ASP.NET's impersonated account can write to Server2.

Generally, that is done by having ASP.NET impersonate
a domain account which has access to both servers.

<identity impersonate="tr ue"
userName="domai n\accountname"
password="someP assword" />

Mind you, after you do that you'll need to grant access permission
to a bunch of directories on Server1 to that account.

Here's the ACL list to the required directories :

http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx

You can shortcut by using this command line from the .Net 2.0 directory on Server1
*after* you configure the domain\accountn ame which ASP.NET will be impersonating,
in web.config:

aspnet_regiis -ga domain\accountn ame

Verify that the permissions have been applied
to the whole directory list after you issue the command.

Also, of course, you'll have to grant write permission to the network share on Server2
to the domain account ASP.NET is now impersonating, which will be accessing the
network share on Server2.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"pxpilot" <px*****@gmail. comwrote in message news:dd******** *************** ***********@a1g 2000hsb.googleg roups.com...
HELP!
I know there's a lot of urls out there, please don't reply with a
link.
I have tried them all but i guess i am missing something.

I have 2 servers on the same network, my ASP.NET runs on Server1 and
need to write RSS to a Server2
Something like this:
Dim enc As Encoding = Encoding.UTF8
Dim objXMLTW As New XmlTextWriter(" \\Server2\wwwro ot\SiteRoot
\rss.xml", enc)
objXMLTW.WriteS tartDocument()
objXMLTW.WriteS tartElement("rs s")
objXMLTW.WriteE lementString("B lah", "Blah Blah Blah")
objXMLTW.WriteE ndDocument()
objXMLTW.Flush( )
objXMLTW.Close( )

I have tried:
* added <identity impersonate="tr ue"/to web.config (in Server1)
* added Full Control to Server1\ASPNET Server1\IUSR_Se rver1
Server1\IWAM_Se rver1
* created virtual directory on Server1 and tried both "Connect As"
options

I keep getting "Logon failure: unknown user name or bad password."

Ideas?


Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2705
by: Norm Wong | last post by:
If anyone is interested in using db2uext2 with Cygwin gcc compiler on Windows, I've modified the IBM provided sample with the attached file. There are two main modifications. The mkdir command is the POSIX compliant version as opposed to the MicroSoft C compiler. The second parameter to mkdir is the file mode. In this case, I've made the directories created to be read/write/execute(list) for all users.
2
14411
by: Chris Fink | last post by:
I am using the System.IO.File class to determine if a file exists on a network share. The File.Exists method keeps returning false, even though the file does exist. The MSDN documentation states, "If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path."
4
1414
by: Scotty | last post by:
I have a file on a server. How do I get a stream to write to this file. I can read this through the following string filePath = "http:\\QuickServ1\TestLogs\Log.txt" WebRequest req = System.Net.WebRequest.Create(filePath); HttpWebRequest hreq = (System.Net.HttpWebRequest)req; WebResponse res = hreq.GetResponse();
1
1181
by: cur | last post by:
Ok, I need some help here. First of all, here's the offending bit of code: Private Sub WriteToFile(ByVal strPath As String, ByRef buffer As Byte()) Dim newFile As System.IO.FileStream = New System.IO.FileStream(strPath, System.IO.FileMode.Create, IO.FileAccess.Write) newFile.Write(buffer, 0, buffer.Length) newFile.Close() End Sub
1
1502
by: SL33PY | last post by:
Hi, I'm currently busy writing an xsd at one point in time i whish that my xml must look like: <object> <loc> <disk> <drive>c</drive> <path>temp\path</path> <files>*.*</files> </disk>
8
3033
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around the plant with a wireless connection. There are some pockets of non-connectivity. I've been tasked with disabling the submit button on the form if the network is unavailable. Possible solution: I can instantiate a timed process (VB.NET 2.0
0
3234
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want to register new customer or companies they will enter the information in Windows Form and the program automaticaly creates the WORD document under specific folder under application path. Once the empty word file created than ask user if they want...
0
1232
by: Lars | last post by:
I am using Microsoft .NET (2.0) PrintPreviewDialog and all works well when the Windows default printer is set to a local printer or a network printer on a Windows server, but if I set it to a Samba network printer, it slows down to a crawl. With a Windows server network printer, it takes about 10 seconds to render 100 pages. With a Samba network printer, it takes over 5 minutes! I can see that the preview control is generating
5
12589
by: DotNetDanny | last post by:
Hello Machine: Windows Vista Business, standalone machine (no domain). Installed an old classic ASP webapplication in IIS7, running under a new app.pool with 'NETWORK SERVICE' account (using existing app.pool gives same results). This webapplication tries to write to a log file. Used Process Monitor (from Sysinternals) for monitoring purposes. Logged in to my machine as 'MYPC\danny', a local account that's a member of the administrators...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10373
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5547
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.