Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Unable to down load file using xp_cmdshell

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-03 : 08:43:46
Raj writes "Hi Friends,
I m unable to connect to SQL server through application as a user. When I try to connect it give me error

[microsoft][ODBC SQL Server Driver][SQL server] xp_cmdshell failed to execute becuase logonUserW returns error 1385. Please make sure the service account SQL server running under has appropriate privilage. For more information, search Book online for topic related xp_sqlagent_proxy_account.

Anyway help in this regard is Highly appriciated.
Thanks
Raj"

kpsreenath
Yak Posting Veteran

52 Posts

Posted - 2006-03-03 : 09:12:08
I am copy pasting the documentation of xp_cmdshell from the books online below. I hope this answers your question.There is a similar thread which you can take a look
http://forums.databasejournal.com/archive/index.php/t-21400.html

From books online.
When you grant execute permissions to users, the users can execute any operating-system command at the Microsoft Windows NT® command shell that the account running Microsoft SQL Server™ has the needed privileges to execute.

By default, only members of the sysadmin fixed server role can execute this extended stored procedure. You may, however, grant other users permission to execute this stored procedure.

When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed server role, xp_cmdshell will be executed under the security context in which the SQL Server service is running. When the user is not a member of the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy account, which is specified using xp_sqlagent_proxy_account. If the proxy account is not available, xp_cmdshell will fail. This is true only for Microsoft® Windows NT® 4.0 and Windows 2000. On Windows 9.x, there is no impersonation and xp_cmdshell is always executed under the security context of the Windows 9.x user who started SQL Server.



Note In earlier versions, a user who was granted execute permissions for xp_cmdshell ran the command in the context of the MSSQLServer service's user account. SQL Server could be configured (through a configuration option) so that users who did not have sa access to SQL Server could run xp_cmdshell in the context of the SQLExecutiveCmdExec Windows NT account. In SQL Server 7.0, the account is called SQLAgentCmdExec. Users who are not members of the sysadmin fixed server role now run commands in the context of this account without specifying a configuration change.

Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-03-07 : 04:09:03
are you just connecting or trying to run something using xp_cmdshell?

quote:
Originally posted by AskSQLTeam

Raj writes "Hi Friends,
I m unable to connect to SQL server through application as a user. When I try to connect it give me error

[microsoft][ODBC SQL Server Driver][SQL server] xp_cmdshell failed to execute becuase logonUserW returns error 1385. Please make sure the service account SQL server running under has appropriate privilage. For more information, search Book online for topic related xp_sqlagent_proxy_account.

Anyway help in this regard is Highly appriciated.
Thanks
Raj"



--------------------
keeping it simple...
Go to Top of Page

srikant
Starting Member

1 Post

Posted - 2009-06-23 : 07:37:26
Thanks Sreenath
It helped...
In my case I added the required SQL Server Users
to the Role "SYSADMIN" that were missing and phew!!

It worked like a song

Regards
Srikant
Go to Top of Page
   

- Advertisement -