Use SQL Server's xp_cmdshell extended stored procedure to pass an operating-system command to the Windows command shell on the SQL Server host. The feature is disabled by default. An authorized SQL Server principal must be able to execute xp_cmdshell; the child process runs as the SQL Server service account for sysadmin/CONTROL SERVER callers, or as the configured xp_cmdshell proxy account for non-sysadmin callers. Remote use requires a client-reachable SQL Server endpoint; Internet-based use applies only when the endpoint is publicly reachable through the configured listener, routing, and firewall, and still requires valid SQL credentials and permissions.
Variant:
Execute an OS Command via xp_cmdshell
powershell
RESTRICTED_ACCESS_BLUR_MARKER
RESTRICTED_ACCESS_BLUR_MARKER
RESTRICTED_ACCESS_BLUR_MARKER
RESTRICTED_ACCESS_BLUR_MARKER