Permission for ASP.NET application on web server to access shared folder on another server

222

Here's one way you could it:

  • Create an account on the web server for the web service to run as.
  • Create an account with the same username and password on the virus scanning machine.
  • In the NTFS permissions for the shared folder grant the account you created rights to write to the folder.
  • In the share permissions on the shared folder set "Everyone / Full Control".
  • Be sure you have good name resolution between the web server and the machine hosting the shared folder.

Edit:

I've never used the "impersonate" functionality that sparks refers to in his answer. I don't think this is going to do what you want anyway, seeing as how there isn't a way for a standalone machine to impersonate an account from another standalone machine (or from a domain that the impersonating machine is not a member of).

Share:
222

Related videos on Youtube

frosty
Author by

frosty

Updated on September 17, 2022

Comments

  • frosty
    frosty almost 2 years

    I'm using both spark and .aspx view engines. My partial is in aspx so i'm tring to call from my spark engine.

    I've seen something like the following

    ${Html.RenderPartial("HeaderControl")}

    Seems like i'm missing a reference, can't really see what.

    Dynamic view compilation failed. d:\Website\Views\Retailer\Index.spark(11,23): error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

    spark

    <use namespace="MvcContrib.UI"/>
    <use namespace="MvcContrib.UI.Grid"/>
    <use namespace="MvcContrib.UI.Pager"/>
    <use namespace="MvcContrib.UI.Grid.ActionSyntax"/>
    <viewdata model="EStore.Domain.ViewModel.RetailerViewModel"/>
    
    
    <content name="MainContent">
      ${Html.RenderPartial("HeaderControl")}
    </content>
    
  • Sir Rippov the Maple
    Sir Rippov the Maple about 15 years
    Thanks. One question though: what do you mean by good name resolution? Do you mean DNS, or is it something else?
  • Spence
    Spence about 15 years
    You just want to be sure that the web server can access the File and Print Sharing service on the remote machine via whatever name or IP address your app is using. If you can logon to the web server w/ the account you create and put \\server\sharename in the Start / Run dialog and access the remote server you'll be good to go.
  • Madhu Cheluvaraju
    Madhu Cheluvaraju about 15 years
    Ahh yes, ghetto domain.
  • Spence
    Spence about 15 years
    @MatthewC: I prefer to call it the "poor man's trust relationship", but yeah, it's "ghetto domain"... smile
  • ezakto
    ezakto about 15 years
    Looks like I forgot about the "use the same username and password on both standalone machines" trick. (or as others are calling it the "ghetto domain") :)
  • Spence
    Spence about 15 years
    Never underestimate the power of the poor man's trust relationship! smile If I had a dollar for every time it got me out of an ugly authentication situation...