When we try to create a xp_cmdshell proxy using SQL Server Management studio, we get error 15137.
EXEC sp_xp_cmdshell_proxy_account 'domainaccount' ,'[password]'
Error:
Msg 15137, Level 16, State 1, Procedure sp_xp_cmdshell_proxy_account, Line 1 [Batch Start Line 1]
An error occurred during the execution of sp_xp_cmdshell_proxy_account. Possible reasons: the provided account was invalid or the ‘##xp_cmdshell_proxy_account##’ credential could not be created. Error code: 5(Access is denied.), Error Status: 0.
Fix:
- Run SQL Server Management Studio as Administrator
- Validate and make sure password is correct
Alternatives:
Create a credential
USE [master]
GO
ALTER CREDENTIAL [##xp_cmdshell_proxy_account##] WITH IDENTITY = domainaccount', SECRET = N'password'
GO