Re: xp_cmdshell generates "Login failed for user 'SVCtoronto'." when run in SQLAgent job.

From: Wayne Snyder (wayne.nospam.snyder_at_mariner-usa.com)
Date: 01/27/05


Date: Thu, 27 Jan 2005 08:52:32 -0500

XP_Cmdshell is only available to SQL logins who are SQL administrators by
default, and the security context that ALL xp_cmdshell jobs run under the
context that SQL Agent uses for SQL Administrators.

A SQL Administrator can configure xp_cmdshell to be available to non-admin
sql logins, and provide a single NT login which will be used for the
credentials for all of those people....

So xp_cmdshell runs under either the SQL Agent login ( for sql admins) or a
single pre-configure NT login ( for non admins.)

-- 
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Charles Snelgrove" <charles.snelgrove@brooks.com> wrote in message
news:6dcfa2e4.0501261337.ffb57fc@posting.google.com...
> I am trying to upgrade our SQL 7 platform from NT4 Server to Windows
> 2000 Server (while staying at SQL 7).  I have installed SQL 7 on a
> Windows 2000 Server with the latest SP (7.00.1094) and have copied
> everything over from the original server (restored from backup
> devices), including stored procedures, logins, application db's,
> SQLAgent jobs, etc.  Everything seems to be working properly except
> for the SQL Server Agent jobs, which invoke store procedures that make
> calls to "xp_cmdshell", which fail with the error "Login failed for
> user 'SVCtoronto'."
>
> The account SVCtoronto is a domain account (in an Active Directory)
> which belongs to the Administrator's group on the server and is used
> to run MSSQLServer and SQLServerAgent services.
>
> If I use the local System account to run these services, the SQL
> Server Agent jobs run properly without any errors.
>
> Any suggestions would be greatly appreciated.
>
> /Charles


Relevant Pages

  • Re: SQL User SID format?
    ... When you move databases to another server, you can remap users to logins ... capability to remap a user to a login with new ALTER USER syntax - I ... The new ALTER USER syntax works for remapping both SQL and Windows ... this means you already have access to a SID from the syslogins catalog; ...
    (microsoft.public.sqlserver.security)
  • Re: SQL Server 2000 Replication Agents Credentials
    ... the snapshot agent IS using sql login to connect to the ... The pull distribution agent IS using sql ... Do you know where SQL Server 2000 saves the sql ...
    (microsoft.public.sqlserver.replication)
  • Re: Can you update/process AS2005 cube with AMO and SQL authentica
    ... We have cases where the AS server and the Data Source server reside on 2 ... The data source is properly secured using SQL Server ... login and no serious client will accept the login with no password. ...
    (microsoft.public.sqlserver.olap)
  • Login failed for user (null). Reason: Not associated with a trus
    ... I'm running SQL 2000 on two machines, one developer edition, one standard. ... server, running windows 2000 server. ... Basicly for troubleshooting, I also have tried using the sa Login, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • SQL 2000 Email issue
    ... SQL 2000 Developers Editon 8.00.2050 on my Windows XP Pro workstation ... SQL 2000 Server Standard Edition 8.00.2050 on my ... The SQL Agent on both have been configured with the Mail profile. ... On Server 1 My workstation I have maintainance plans setup and the jobs run ...
    (microsoft.public.sqlserver.setup)