• ravisamigo (5/8/2012)


    Hi All,

    xp_cmdshell 'dir \\Server001\e$' - running in Server2

    xp_cmdshell 'dir \\Server002\e$' - running in server1

    OUTPUT : 'Access is denied.'

    But I'm able to access through RUN(WIN+R) command from server1 to server2 and vice versa.

    NOTE: I've given 'full control' permission on both folders in E\ drive in both servers.

    Please advice.

    Thanks and Regards,

    Ravi

    if you touch anything outside of SQL server (local directories, UNC shares, mapped drives, your own credentials don't count and are not used.

    SQL WILL pass your credentials to a linked server, but anything else is using an account you did not intuitively expect it to use.

    SQL Server uses either the account set up as the proxy account, or if that is left blank(the default) it uses account it starts with to try and access the resource:

    or if the above was blank, the account in services:

    That account is often an account which has never logged into the domain, and was never assigned permissions to get to the local disk or network share.

    As a result, you usually need to create a domain account in Active Directory, specifically grant it share access if it doesn't inherit it from Domain\Users or Domain\AuthenticatedUsers and change the account SQL Server starts with to that account.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!