XP_CMDSHELL

  • EXEC XP_CMDSHELL 'DIR \\SERVERNAME\FOLDER' - Access Denied

    OS : Windows server 2008

    SQLServer2008 Standard edition.

    If I use it on a local computer it works fine but if I try to access computer on a network, it returns "Access Denied".

    I have read a lot of articles which says check the permissions. Can anyone tell me what are those permissions and how do I check them?

    Do we need to restart the sqlserver services after enabling the xp

    _cmdshell in surface area configuration?

    Thanks! I would appreciate any help on this...

    Regards,

    Ravi.

  • Is the folder shared and does the user have full control on the folder, i mean to say in Sharing and Security.

    Satnam

  • Yes, I have given full control access to that login under share and security tabs of that shared folder.

    Note: SQLServices are running under local system account.

    Regards,

    Ravi

  • ravisamigo (1/28/2011)


    Yes, I have given full control access to that login under share and security tabs of that shared folder.

    Note: SQLServices are running under local system account.

    Regards,

    Ravi

    Ravi,

    Please note that the Local System Account will have sysadmin privileges on the local server's resources and not on the network share.

    You may do the following:

    1) Change the SQL Server service to start with a Domain account and grant it access to that shared folder.

    2) If you cannot change the service account, you can grant "Everyone" full permissions on that shared drive. This is not recommended if you don't want everyone to have access to that folder.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply