| description | sp_xp_cmdshell_proxy_account (Transact-SQL) | ||
|---|---|---|---|
| title | sp_xp_cmdshell_proxy_account (Transact-SQL) | Microsoft Docs | ||
| ms.custom | |||
| ms.date | 03/16/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine, sql-database | ||
| ms.reviewer | |||
| ms.technology | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | f807c373-7fbc-4108-a2bd-73b48a236003 | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| monikerRange | =azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE SQL Server SQL Database]
Creates a proxy credential for xp_cmdshell.
Note
xp_cmdshell is disabled by default. To enable xp_cmdshell, see xp_cmdshell Server Configuration Option.
Transact-SQL Syntax Conventions
sp_xp_cmdshell_proxy_account [ NULL | { 'account_name' , 'password' } ]
NULL
Specifies that the proxy credential should be deleted.
account_name
Specifies a Windows login that will be the proxy.
password
Specifies the password of the Windows account.
0 (success) or 1 (failure)
The proxy credential will be called ##xp_cmdshell_proxy_account##.
When it is executed using the NULL option, sp_xp_cmdshell_proxy_account deletes the proxy credential.
Requires CONTROL SERVER permission.
The following example shows how to create a proxy credential for a Windows account called ADVWKS\Max04 with password ds35efg##65.
EXEC sp_xp_cmdshell_proxy_account 'ADVWKS\Max04', 'ds35efg##65';
GO
The following example removes the proxy credential from the credential store.
EXEC sp_xp_cmdshell_proxy_account NULL;
GO
xp_cmdshell (Transact-SQL)
CREATE CREDENTIAL (Transact-SQL)
sys.credentials (Transact-SQL)
System Stored Procedures (Transact-SQL)
Security Stored Procedures (Transact-SQL)