Skip to content

Commit 884f9c4

Browse files
authored
Merge pull request #15447 from garyericson/06-12-fix-article-xp-cmdshell
Content Performance: xp_cmdshell
2 parents 680bcb3 + ad79b06 commit 884f9c4

1 file changed

Lines changed: 24 additions & 17 deletions

File tree

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
---
2-
title: "xp_cmdshell Server Configuration Option | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "03/02/2017"
2+
title: xp_cmdshell Server configuration option
53
ms.prod: sql
64
ms.prod_service: high-availability
75
ms.reviewer: ""
86
ms.technology: configuration
97
ms.topic: conceptual
10-
dev_langs:
11-
- "TSQL"
12-
helpviewer_keywords:
13-
- "xp_cmdshell"
8+
dev_langs: "TSQL"
9+
helpviewer_keywords: "xp_cmdshell"
1410
ms.assetid: c147c9e1-b81d-49c8-b800-3019f4d86a13
1511
author: markingmyname
1612
ms.author: maghan
13+
ms.custom: contperfq4
14+
ms.date: 06/12/2020
1715
---
18-
# xp_cmdshell Server Configuration Option
16+
17+
# xp_cmdshell Server configuration option
18+
1919
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)]
2020

21-
The **xp_cmdshell** option is a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] server configuration option that enables system administrators to control whether the **xp_cmdshell** extended stored procedure can be executed on a system. By default, the **xp_cmdshell** option is disabled on new installations. Before enabling this option, it is important to consider the potential security implications associated with the use of this option. Newly-developed code should not use this option as it should generally be left disabled. Some legacy applications require it to be enabled, and if they cannot be modified to avoid the use of this option, it can be enabled by using the Policy-Based Management or by running the **sp_configure** system stored procedure as shown in the following code example:
21+
This article describes how to enable the **xp_cmdshell** SQL Server configuration option. This option allows system administrators to control whether the [xp_cmdshell extended stored procedure](../../relational-databases/system-stored-procedures/xp-cmdshell-transact-sql.md) can be executed on a system. By default, the **xp_cmdshell** option is disabled on new installations.
22+
23+
Before enabling this option, it's important to consider the potential security implications.
24+
25+
- Newly developed code shouldn't use the **xp_cmdshell** stored procedure and generally it should be left disabled.
26+
- Some legacy applications require **xp_cmdshell** to be enabled. If they can't be modified to avoid the use of this stored procedure, you can enable it as described below.
27+
28+
If you need to enable **xp_cmdshell**, you can use [Policy-Based Management](../../relational-databases/policy-based-management/administer-servers-by-using-policy-based-management.md) or run the **sp_configure** system stored procedure as shown in the following code example:
2229

23-
```
30+
``` sql
2431
-- To allow advanced options to be changed.
25-
EXEC sp_configure 'show advanced options', 1;
32+
EXECUTE sp_configure 'show advanced options', 1;
2633
GO
2734
-- To update the currently configured value for advanced options.
2835
RECONFIGURE;
2936
GO
3037
-- To enable the feature.
31-
EXEC sp_configure 'xp_cmdshell', 1;
38+
EXECUTE sp_configure 'xp_cmdshell', 1;
3239
GO
3340
-- To update the currently configured value for this feature.
3441
RECONFIGURE;
3542
GO
3643
```
3744

38-
## See Also
39-
[Server Configuration Options (SQL Server)](../../database-engine/configure-windows/server-configuration-options-sql-server.md)
40-
[Administer Servers by Using Policy-Based Management](../../relational-databases/policy-based-management/administer-servers-by-using-policy-based-management.md)
41-
42-
45+
## Next steps
46+
47+
- [xp_cmdshell extended stored procedure](../../relational-databases/system-stored-procedures/xp-cmdshell-transact-sql.md)
48+
- [Server Configuration Options (SQL Server)](server-configuration-options-sql-server.md)
49+
- [Administer Servers by Using Policy-Based Management](../../relational-databases/policy-based-management/administer-servers-by-using-policy-based-management.md)

0 commit comments

Comments
 (0)