Workflow Soluiton

 View Only
  • 1.  Permissions to copy file over the network

    Posted Jan 06, 2011 12:07 PM

    Hi

    I mapped a drive (Z:\) on my Workflow Server and I use a Copy File component to copy a template and paste it in another folder.  Everything works fine in debug.  The template file is copied and the new file is created in the other folder.

    When I publish the project and try to run it, the file is not created.  I have an error in the logs: The remote server returned an error: (401) Unauthorized

    Just to make sure I modified the NTFS permissions to "Everyone Modify" in the destination folder but still no luck.

    Does anyone know which permissions I need to give on the destination folder to let workflow copy a file?   Why is it working in debug but not working when running the project from the server?

     

     

     

    Thanks



  • 2.  RE: Permissions to copy file over the network
    Best Answer

    Posted Jan 06, 2011 12:41 PM

    When you run things in the debugger, the project is using your credentials to access things.

    The problem is that your app pool (IIS) identity is responsible for performing the actions defined in your published project.  By default this is network service, which doesn't have rights to touch other area of your filesystem.  External systems would see it as an anonymous user.  If both systems are in the same domain, it will have slightly greater privileges, but not much more. 

    The typical solution is to create a basic user account on your IIS server (or a basic domain account), use the aspnet_regiis -ga username to make it capable of running ASP.NET code, and change your App Pool's identity to the new account. 

    Give this new account appropriate filesystem rights to wherever it needs access. 

    I'm a bit unsure of any special requirements for using mapped drives.  The easiest way to verify would be to logon to your IIS server using the new account, and confirm that you can map the drive.  If it proves to be too much hassle, switch to using a UNC  path  \\server\sharename

    This technique will also make it easier to secure your access to SQL as you can use a Windows account for access to your database and avoid storing username/password info in your publication settings.

    Another alternative is to setup an FTP server and use FTP components to access the remote filesystem.



  • 3.  RE: Permissions to copy file over the network

    Posted Jan 06, 2011 12:47 PM

    A slightly out of date MS KB article on setting up the app identity account:

    http://msdn.microsoft.com/en-us/library/ms998297.aspx

     



  • 4.  RE: Permissions to copy file over the network

    Posted Jan 07, 2011 07:00 AM

    Thanks for the feedback scottwed

    I tried it but I guess I missed a step.    I tried two things:

    1 - Create a local account on the Workflow server (this account have local admin privileges on the server).   I ran the aspnet_regiis -ga command against that account.   I added this account in the Identity tab of the Application Pools properties. 

    I can open my web forms but it's a lot slower than before.   I would say 5 times slower.   I also have some bugs with ADinfo not being displayed correctly anymore.

     

     

    2 - I tried the same steps as point #1 but instead I used a domain account

    When I try to open my web forms it asks me for credentials to access the pages.   None of the domain accounts I tried would work.

    Then I changed the Directory Security of the Default Web Site in IIS.  I disabled anonymous access and I enabled Integrated Windows Authentication.   Note:  My workflow web sites were already like that but it was not configured like that in the root of IIS.   Not sure if I was supposed to change that but I tried anyway.

    After that I was able to get something.   The workflows are trying to run but it looks like it have a problem to find my ADinfo.    If I try a workflow that is not using the Get Current User component it runs just fine.   When I switch to a workflow using the Get Current User component the process take the "Not found" path and then exits

     

     

     

    Do you have any thought of what is happening here?

    Thanks



  • 5.  RE: Permissions to copy file over the network

    Posted Jan 07, 2011 12:44 PM

    Did you try the steps listed near the bottom of the article for setting a SPN on the domain account? 



  • 6.  RE: Permissions to copy file over the network

    Posted Jan 14, 2011 06:24 AM

    It looks like last time I stopped reading before the end of the article...

     

    Thanks scottwed

     

    It's working now



  • 7.  RE: Permissions to copy file over the network

    Posted Jan 14, 2011 07:49 AM

    Don't forget to tick the "MARK AS SOLUTION" for the post that gave you the most correct answer ;)



  • 8.  RE: Permissions to copy file over the network

    Posted Jan 14, 2011 12:49 PM

    Glad that worked, I don't blame you for stopping :). Tthat article doesn't do a great job of explaning why those last few steps are relevant.