Sql-server – exec xp_cmdshell ‘sc \\ start

sql server

When I execute this on sql server on another machine (in same sub net) I am getting "Access is denied". But when I did it from command prompt (sc \ start ) it is working.

Please advice why I am getting access denied when I am doing it from sql server using exec xp_cmdshell cmd

Best Answer

You are doing a double hop impersonation that requires delegation.