[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

FSO and network share access

I am having one heck of a time with this one folks.
I have 2 computers in a workgroup(no domain as it is not needed with only 2 PC's)
I have a folder on my development PC, that is currently shared.  On my server box, I have mapped the shared folder as a drive.
I have added a user called IUSR_servername to my developer's box which has read-only access to the said shared folder.

Now...I am using the filescriptingobject to recurrsivly list folders/subfolders/files, given a local path (or using server.mappath(), as both of these work on a local folder), however when I change my path to the networked drive (or share{\\machiinename\foldername})  I come up with 1 of 2 errors.  The first one being 'Path Not Found', the other 'No Permission'.

In IIS if I setup a virtual directory to this shared folder, I get the little red stop sign, and I get the 'Path Not Found', if I 'connect as...' I get 'No Permission' and it does not matter what user I use, it still comes up with this error.  I have added all sorts of users to the dev machine and the server machine, matching passwords, as well as setting NTFS rights with said users, and I still get the 'No Permission' error.

Please help...I need to know how to figure this out

p.s.  If the code is needed please ask
0
kevp75
Asked:
kevp75
  • 12
  • 10
1 Solution
 
fritz_the_blankCommented:
This might help:

http://support.microsoft.com/kb/q197964/

And from here:

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20073348.html?query=FSO+mapped+drive&topics=97

You can Use a mapped drive thru FSO indeed , I tried it lots of time successfully.. the concept is to
log to the box using the IUSR account and map the needed drive from there (since the map is a service)
then the IUSR will be able to "See" it from asp.. it's a tricky issue, a bit hard to emplement for a
beginner read also what you should do:

How does FileSystemObject access files from a UNC \\share\?

IUSR_webservername on the web server trying to access the share must have access to the share. That
means IUSR_webservername must exist as a domain user (or at least a local user on the machine with the
share) WITH THE SAME PASSWORD and possessing appropriate permissions. We recommend RXW for IUSR_webservername
because some versions of FileSystemObject seem to choke on anything less.

FtB
0
 
bvinsonCommented:
This is how one person resolved this issue:

Problem solved, thanks so much for the help.

Here's how it is set up now

Created a share on the remote server with the appropriate persmissions

Added anonymous account on the remote server using the same userid and password as the web server (IUSR_<servername>). - Reference Microsoft article ID: 184566

Added the local account to the guest group on the remote server

Added the guest group to the shared folder access list

Back on the web server on the site I unchecked the allow anonymous account to control the password option on the web site - Reference Microsoft article ID: 197964

Works like a charm, thanks again for helping point the way

The full discussion can be viewed at: http://forums.devx.com/showthread.php?threadid=136937

It looks like you may have completed almost everything necessary, but maybe one step was missed?  Since you are not actually attempting to use the mapped path (network drive letter), as long as the permissions are correct and there isn't a typo in the path you specify, you should be good to go.

bvinson
0
 
kevp75Author Commented:
you know..I think that is the only thing I did not try was the password.

On the dev machine, I just left it blank, but on the server I let IIS control it.
I will try this now
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
fritz_the_blankCommented:
One last thing--if you have Norton Anti-Virus installed, make sure that you disable script blocking or else your page will just hang.

FtB
0
 
kevp75Author Commented:
nope....didn't work
here is a link to the file
http://www.inrsolutions.com/temp/inrsa.asp

the very first line you see is the mapped drive, it is displayed by server.mappath("/music")...same thing with the line that is making the error
all my permissions are set correctly
0
 
fritz_the_blankCommented:
It seems to be working?

FtB
0
 
kevp75Author Commented:
What you are seeing there is a local folder, not the shared folder.  I have yet to get the shared folder to work with this script.  I've also tried mapping it as a network drive...when I do this and change the 'connect as....' to administrator, I get a 'path not found error'.....when I use the same method except with 'IUSR_machinename' as the user, I get 'No Permission'

I get these errors even if I add IUSR_servername as a user on the other machine, and add that user to the folders permissions.
0
 
fritz_the_blankCommented:
Did you duplicate the IUSR account on the remote server--it has to be the same account rather than each machine's IUSR account:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q184566

Also, I think that you need to use UNC paths for this.

ftB
0
 
kevp75Author Commented:
I did not change the security policy as the article suggests, but yes I added IUSR_servername to the other machine as a user.  I didn't add the group, I will try this when I get home from work tonight.

Thank you for your help :!
0
 
fritz_the_blankCommented:
You are welcome.

This is confusing, but it is like this:

1) the user logs on to your site
2) it does so under the credentials of IUSR_WebServerName
3) you have a share
4) you set the permissions for IUSR_RemoteServerName

As you can see, 2 and 4 are in conflict, hence the permission denied. With the article above, 4 becomes:

4) you set the permissions for IUSR_WebServerName

FtB
0
 
kevp75Author Commented:
ok, I did all that, however I still get the same error, telling me the 'Path not found'
here is the code I am using, maybe I'm missing something in this, please note that my first call to server.mappath("/music") shows the UNC path on the page, however, when I pass it to the function I get 'Path not Found'

<script type="text/javascript">
window.onload = function p9_init(){
      if (document.getElementById){
            if (document.images){
                  icons = new Image();
                  icons.src = "icons.gif";
            }
            var eLink = document.createElement("link");
            eLink.rel = "stylesheet";
            eLink.type = "text/css";
            eLink.media = "all";
            eLink.href= "style.css";
            document.body.appendChild(eLink);
            
            ULnodes = document.getElementById("treenav").getElementsByTagName("UL");
            len = ULnodes.length;
            for(var i = 1; i < len; i++){
                  var folder = ULnodes[i].parentNode.firstChild;
                  folder.onclick = p9_tc;
                  folder.className = "fc";
            }
}      }
function p9_tc(){
      var target = this.nextSibling.nextSibling.style;
      target.display = target.display=="block"?"none":"block";
      this.className = this.className == "fc"?"fo":"fc";
}

expand = false;
function p9_ec(){
      for(var i = 1; i < len; i++){
            ULnodes[i].parentNode.firstChild.className = expand==false?"fo":"fc";
            ULnodes[i].style.display = expand==false?"block":"none";
      }
      expand = expand==false?true:false;
}
</script>
<%=server.mappath("/music")%>
<div id="treenav">
<p><a class="command" href="#" onclick="p9_ec('e')">Expand All</a>/<a class="command" href="#" onclick="p9_ec('c')">Collapse All</a></p>
<ul id="treenav_root">
<% ListFolderContents(server.mappath("/music")) %>
</ul>
<% sub ListFolderContents(path)
     dim fs, folder, file, item, url
     set fs = CreateObject("Scripting.FileSystemObject")
     set folder = fs.GetFolder(path)
    'Display the target folder and info.
     Response.Write("<li><a href=""#""><b>" & folder.Name & "</b></a> - " _
       & folder.Files.Count & " files, ")
     if folder.SubFolders.Count > 0 then
       Response.Write(folder.SubFolders.Count & " directories, ")
     end if
     Response.Write(Round(folder.Size / 1024) & " KB total." _
       & vbCrLf)
     Response.Write("<ul>" & vbCrLf)
     'Display a list of sub folders.
     for each item in folder.SubFolders
       ListFolderContents(item.Path)
     next
     'Display a list of files.
     for each item in folder.Files
       url = MapURL(item.path)
         url="../music"&url
       Response.Write("<li><a href=""" & url & """>" & item.Name & "</a> - " & item.Size & " bytes, " & "last modified on " & item.DateLastModified & "." _
         & "</li>" & vbCrLf)
     next
     Response.Write("</ul>" & vbCrLf)
     Response.Write("</li>" & vbCrLf)
   end sub
   function MapURL(path)
     dim rootPath, url
     'Convert a physical file path to a URL for hypertext links.
     rootPath = Server.MapPath("/music/")
     url = Right(path, Len(path) - Len(rootPath))
     MapURL = Replace(url, "\", "/")
   end function %>
   </div>
0
 
kevp75Author Commented:
sorry....please keep in mind that I do not have a domain setup.  There is only these 2 computers (server and client)
0
 
fritz_the_blankCommented:
What happens if you do this:

<%=server.mappath("/music")%>
response.end

Does it show you the correct path?

FtB
0
 
kevp75Author Commented:
it does, in fact, in the code above I've placed it right below the javascript (minus the response.end)

it shows me the UNC, as well as the networked drive letter (when I change the virtual folder to that)
0
 
fritz_the_blankCommented:
>>sorry....please keep in mind that I do not have a domain setup.  There is only these 2 computers (server and client)<<

Then you weren't able to duplicate the IUSR account then?
0
 
kevp75Author Commented:
not an exact duplicate no.  I did create a user called IUSR_servername n the other machine.

Should I create the domain?  I would rather not, as my LAN is only the 2 computers.
0
 
kevp75Author Commented:
sorry, forgot to mention that IUSR_servername on both my server and client share the same password as well
0
 
fritz_the_blankCommented:
I am all confused now. I thought that you had two servers, then they are not two servers, but then they are...


0
 
kevp75Author Commented:
nope, never said I had 2 servers....said i had a server machine, and a developer machine

Comment from kevp75
Date: 05/17/2005 02:23PM PDT
 Your Comment  


sorry....please keep in mind that I do not have a domain setup.  There is only these 2 computers (server and client)

anyways....does this work only in a domain?  Everywhere I look they seem to make references to domains and domain controllers.

If this is the case, then I will find another way to do this, if worse comes to worse I may swap hard drives
0
 
fritz_the_blankCommented:
>>I have 2 computers in a workgroup(no domain as it is not needed with only 2 PC's)
I have a folder on my development PC, that is currently shared.  On my server box, I have mapped the shared folder as a drive.
I have added a user called IUSR_servername to my developer's box which has read-only access to the said shared folder.<<

Sorry, I misread that. The two computers do not need to be on a domain--they just have to have the same IUSR_ account configured on both. The first two links I posted indicate that others have done so. I know that it is tricky, but I just wish that we could figure out why those steps aren't working for you.

FtB


0
 
kevp75Author Commented:
I will try again tonight, starting from scratch...thanks again
0
 
kevp75Author Commented:
I have not been able to get this to work.  The only other thing I can think of is installing IIS on my windows 2k pro box, and then try to duplicate the IUSR_ account
0
 
fritz_the_blankCommented:
Okay, good luck with that.

FtB
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 12
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now