Re: Execute permission on xp_cmdshell
From: Andrés Taylor (andres@rotselleri.com)
Date: 07/18/02
- Next message: Richard Siddaway: "Execute permission on xp_cmdshell"
- Previous message: Ron Broekhuizen: "Execute permission on xp_cmdshell"
- In reply to: Ron Broekhuizen: "Execute permission on xp_cmdshell"
- Next in thread: Richard Siddaway: "Execute permission on xp_cmdshell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Andrés Taylor" <andres@rotselleri.com> Date: Thu, 18 Jul 2002 13:15:25 +0200
Ron,
You'll have to set up the proxy account. You do this in T-SQL like this:
EXECUTE msdb.dbo.sp_set_sqlagent_properties @sysadmin_only = 0
EXEC master.dbo.xp_sqlagent_proxy_account N'SET',
N'NETDOMAIN', -- agent_domain_name
N'ralph', -- agent_username
N'RalphPwd', – agent password
This is the account under which xp_cmdshell will run.
HTH,
-- Andrés Taylor visit me @ http://www.sql.nu/ "Ron Broekhuizen" <ron_broekhuizen@hotmail.com> wrote in message news:OBGPm#jLCHA.1740@tkmsftngp10... > I've written a stored procedure that uses xp_cmdshell to export data to a > textfile: > > CREATE Procedure dbo.usp_OutputToTextFile > ( > @SQL varchar(8000), > @FileName varchar(250) > ) > as > Declare @bcpCommand varchar(8000) > SET @bcpCommand = 'bcp "' + @SQL + '" queryout ' > SET @bcpCommand = @bcpCommand + '"' + @FileName + '" -c -T ' > --print @bcpCommand > execute master.dbo.xp_cmdshell @bcpCommand > GO > > I've granted users permission to execute this Sproc. When these users try to > execute the Sproc they get a message that they have no permissions to > execute the xp_cmdshell. > > I suspected xp_cmdshell would be executed with the permissions of the > calling Procedure: dbo. But this is not the case. Why is that?? > > I don't want to grant users permissions to the master-DB. > > Any ideas?? > > > >
- Next message: Richard Siddaway: "Execute permission on xp_cmdshell"
- Previous message: Ron Broekhuizen: "Execute permission on xp_cmdshell"
- In reply to: Ron Broekhuizen: "Execute permission on xp_cmdshell"
- Next in thread: Richard Siddaway: "Execute permission on xp_cmdshell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|