Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FSO Object For Files on Remote Computers

Status
Not open for further replies.

JR4VB

Technical User
Jan 13, 2003
36
US
Hello All,

I know this is a classic problem but yet I still have more questions. I am using the file system object to read and modify files on a remote Win 2k Server through an ASP. I have converted the IUSR account on the 2k IIS server to a domain account with permissions on the specific file on the remote computer I am targeting. But I am still getting access denied. I have added this IUSR ID to have Log on locally permissions on the remote system and many others Local security permissions just for testing with no luck. It does work however to add the Domain IUSR ID into the Local Admin group on the remote system. This isn't the proper fix and something I would rather not do. Is there something in the local security policy I can give the IUSR account access to, to make this work. Or what is giving me the Access Denied when the ACL on the file should allow access? Thanks For Any Help!!

JR
 
I am using a UNC name through a drive share. Not an actual mapped drive on the IIS.
 
OK I mapped a drive. Right now the IUSR ID is a power User on the remote system. And I am still getting access denied. If I put IUSR in Local Administrators group it does work.
 
is IUSR_MACHINENAME a domain account, if not use a domain accoutn for IIS services then it should do it. If your LAN admin does not like this idea, I think its a bit of a security hole, then lookup on the MS web site Impersonate user its code for a DLL that allows you to run tasks in an ASp app as a differnet user.
 
This is a Domain account that is how I am adding the IUSR account into the local groups on the remote system. I just am curious why it is need Administratice previliges to do this. I am guess it is setting in the Local Security Policy but I have not found which one yet.
 
Make the user a domain admin, then it will work on all server since Domain admins are automagically local admins.
 
You're right that will work.....Though this is a wrong step in the way of security. I could maybe live with the IUSR domain account being a Administrator on a couple of select computers but I didn't really want to resort to Domain Admin. I guess I was looking for What exactly is needed to do a Read/Write using the File System Object on a remote system with ASP code(In the Way of Security).
Reguardless of the somewhat Less ingenious responses thanks for the input.
 
I would suggest my earlier post about Impersonate user, I use here for the same thing. If you can't find it, let me know and I'll email you dll.
 
I will try this tomorrow when I get back to work
Thanks
 
For Read/Write using the File System Object on a network computer you have to map the share to a drive then you can use it.
When maping you will tell there what user you log in and that user needs to have the corect permision or at least read permission to that share.

________
George, M
 
This is My Code For the Impersonate User....
I get the Following Error (0x8007052E)
Which Means Bad Password or Error Authenticating
The User ID/Pass are Correct...Could I try Your DLL?
plymouthbypetty@hotmail.com
Or If you see and error in the Code let me know.

<% Option Explicit
Dim objLogon
Set objLogon = Server.CreateObject(&quot;LoginAdmin.ImpersonateUser&quot;)
objLogon.Logon &quot;UserName&quot;, &quot;Pass&quot;, &quot;Domain&quot;
%>
<HTML>
<HEAD>
<Center>
<h2>Page Heading</h2><br>
</HEAD>
<BODY>

<%
Dim TEMP2
TEmp2 = Request.servervariables(&quot;Logon_User&quot;)
REsponse.Write Temp2

Dim A,B
Set A = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set B=A.OpenTextFile(&quot;T:\test.txt&quot;,1)

Response.Write Trim(B.ReadLine)
B.Close

objLogon.Logoff
Set objLogon = Nothing
%>
</Body>
</Html>
 
No your code look exactly like mine, I'll email you the dll.
 
You should try this way.

Some help
- objNet.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword])

Code:
set objNet=Server.CreateObject(&quot;WScript.Network&quot;)
objNet.MapNetworkDrive &quot;Z:&quot;,&quot;\\myserver\myshare&quot;,false,&quot;myuser&quot;,&quot;mypassword&quot;
'and now with fso you can write read on the Z drive
objNet.RemoveNetworkDrive &quot;Z:&quot;

you can take a look here but notice that it uses WSH object wich only creates the object.


________
George, M
 
WOW I actually go that to work..
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top