SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Start a remote service from SQL??
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mangalau
Starting Member

11 Posts

Posted - 05/04/2012 :  16:17:08  Show Profile  Send mangalau a Yahoo! Message  Reply with Quote
I wanna start a service on a remote machine. I use
exec..xp_cmdshell 'sc \\remotemachine start messenger'
From cmd on windows it works, from SQL it doesn't.
The SQL account is a member of a domain admin.
I tried to create a new SQL user a grant him acces to xp_cmdshell
i stil get an error Error 5: Access is Denied.

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 05/04/2012 :  17:10:13  Show Profile  Visit tkizer's Homepage  Reply with Quote
What account are you using for the SQL Server service? That's the account that needs the access, not the person who is logged into the query window.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Sachin.Nand
Flowing Fount of Yak Knowledge

2937 Posts

Posted - 05/05/2012 :  15:18:37  Show Profile  Reply with Quote
First your account by which you invoke xp_cmdshell needs to be a member of sysadmin fixed role.If that's true then the xp_cmdshell will execute under the security context of the account under which sql server service is running.

After Monday and Tuesday even the calendar says W T F ....
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000