locked
Can`t connect to SharePoint library through UNC when running CMD as one user and logged in as another user to the machine RRS feed

  • Question

  • Hi,

    I`ve managed to open an xls file within a SharePoint library through UNC path by typing the UNC path in a command prompt window.

    The problem is that this works only when the user that has access to the xls file in the SharePoint library is logged to the machine where I run the command prompt window.

    If I user another user to log into the machine and run the command prompt as the user that has access to the file I get an access denied message.

    Do you have any idea why it is failing when I log to my machine with another user but try to open the file with the right user?

    I use a windows 2003 server as the machine I try to open the SharePoint file from

    MOSS

    IIS 6

    The account that is trying to access the file is an admin account on my 2003 server

     

    Thank you

     

     

    Wednesday, February 23, 2011 4:34 PM

Answers

  • This is happening because the "Run As" command only set the execution account for the running process (cmd.exe) to run as that user.  When you try to access cross network data like in this case, Windows is still passing the logged on user's credentials to the server which is why your command and access attempt fails.

    This behavior is by design because of security concerns and there is no workaround for it.

     


    I trust that answers your question...

    Thanks
    C

    http://www.cjvandyk.com/blog
    • Marked as answer by Peng Lei Thursday, March 3, 2011 7:31 AM
    Wednesday, February 23, 2011 5:21 PM
    Answerer

All replies

  • This is happening because the "Run As" command only set the execution account for the running process (cmd.exe) to run as that user.  When you try to access cross network data like in this case, Windows is still passing the logged on user's credentials to the server which is why your command and access attempt fails.

    This behavior is by design because of security concerns and there is no workaround for it.

     


    I trust that answers your question...

    Thanks
    C

    http://www.cjvandyk.com/blog
    • Marked as answer by Peng Lei Thursday, March 3, 2011 7:31 AM
    Wednesday, February 23, 2011 5:21 PM
    Answerer
  • Ok I thouhgt this is related to the issue I encounter with my application.

    I have a web application which is impresonating the user the that has access to excel file in the sharepoint library. however while I can get this working in my set of servers (windows 2003 and MOSS as well) my client which is using my web application as well is failing.

    Do you know of any restirctions that the SharePoint library has for impresonated user when trying to read files through UNC path?

    I assume that in my set of servers the user I'm impresonating has some additional access (probably on the SharePoint side) that my client is missing.

     

    Thanks again for all of your help

    Wednesday, February 23, 2011 6:02 PM