Introduction

Spawns a Windows command shell and passes in a string for execution. Any output is returned as rows of text.

Problem

Disable xp_cmdshell

Solution

https://github.com/steverezhener/DBA/blob/master/Procedures/bestpractices.usp_change_server_xp_cmdshell.sql

Example

Based on

https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql?view=sql-server-ver16