Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 Security
»
Allow SQL user to execute xp_cmdshell.
Allow SQL user to execute xp_cmdshell.
Rate Topic
Display Mode
Topic Options
Author
Message
Richard-760904
Richard-760904
Posted Wednesday, June 17, 2009 4:25 PM
Grasshopper
Group: General Forum Members
Last Login: Monday, March 11, 2013 8:12 AM
Points: 10,
Visits: 300
Allow SQL user to execute xp_cmdshell.
OS: MS Windows Server 2003 Standard SP2
SQL: Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)
Nov 24 2008 13:01:59
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
This computer was standalone and the SQL user running all the jobs had the sysadmin role.
Now the computer is joined to the domain and I have removed the sysadmin role. Among the many errors I am fixing is not being able to execute xp-cmdshell. Here is the command and the error:
exec xp_cmdshell 'ver';
Msg 229, Level 14, State 5, Procedure xp_cmdshell, Line 1
The EXECUTE permission was denied on the object 'xp_cmdshell', database 'mssqlsystemresource', schema 'sys'.
I have successfully executed this command:
EXEC sp_xp_cmdshell_proxy_account 'domain\user', 'password';
I'm certain the user/password is correct because if I enter one of them wrong the command fails.
The sa user is able to successfully execute xp_cmdshell
Some web pages suggest that I need to modify the xp_cmdshell procedure to allow it to be executed by the sql user. However, I cannot find the procedure. Does this need to be done? Will someone please point me to the relevant manual page or web page that has detailed instructions on how to do it? Or maybe someone just knows the *secret* command to make this work and would be willing to send it to me. Is there a better method?
This job builds some files and then FTPs them to another computer. Calling a DOS .bat file using xp_cmdshell is what fails.
Post #737065
WayneS
WayneS
Posted Wednesday, June 17, 2009 8:13 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 9:12 AM
Points: 6,370,
Visits: 8,235
This
link
might help you find what you're looking for.
Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then
DON'T USE IT
on a production system! After all,
you
will be the one supporting it!
Links:
For better assistance in answering your questions
,
How to ask a question
,
Performance Problems
,
Common date/time routines
,
CROSS-TABS and PIVOT tables Part 1
&
Part 2
,
Using APPLY Part 1
&
Part 2
,
Splitting Delimited Strings
Post #737106
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.