Sqlserver开启xp_cmdshell

 

Sqlserver开启xp_cmdshell:

EXEC sp_configure ‘show advanced options‘, 1;

 

RECONFIGURE WITH OVERRIDE;

 

EXEC sp_configure ‘Ole Automation Procedures‘, 1;

 

RECONFIGURE WITH OVERRIDE;

 

EXEC sp_configure ‘show advanced options‘, 0;

 

exec master..xp_cmdshell “whoami”