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
 General SQL Server Forums
 New to SQL Server Programming
 Issue with master..xp_cmdshell

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-02-13 : 03:49:13

Hi i have SP which extracts the data to csv files. i call this sp from .net code which is using 'sa' user id

i executed below
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1;
RECONFIGURE;

every thing worked perfectly fine.. one fine day i got error abt permission issue..

i executed "GRANT EXECUTE on xp_cmdshell to public"

then i get one more issue

Msg 15153, Level 16, State 1, Procedure xp_cmdshell, Line 1
The xp_cmdshell proxy account information cannot be retrieved or is invalid. Verify that the '##xp_cmdshell_proxy_account##' credential exists and contains valid information.

i tried my best to figure out not able please help me out.

========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-13 : 04:05:04
Works great for me
USE Master
GO

GRANT EXECUTE ON dbo.xp_cmdshell TO Public



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-02-13 : 04:23:20
that wounderful for you.. but for me it does not work

by the way i am using SQL 2005. what is that i can do with "xp_cmdshell proxy account "

i tried executing



EXEC sp_xp_cmdshell_proxy_account 'domain/sa', 'xxx'
i get one more error..
Msg 229, Level 14, State 5, Procedure sp_xp_cmdshell_proxy_account, Line 1
The EXECUTE permission was denied on the object 'sp_xp_cmdshell_proxy_account', database 'mssqlsystemresource', schema 'sys'.

guys i am stuck.. help me out..

========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-13 : 04:26:43
For which database are you connected when granting?
As you see by my example, you must be in MASTER database.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-02-13 : 04:38:44
master....

can i login as sa or do have to use some other account to execute it
========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page
   

- Advertisement -