MS SQL Server

Enable xp_cmdshell on MS SQL Server 2005+

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
-- To allow advanced options to be changed.  
EXEC sp_configure 'show advanced options', 1;  
GO  
-- To update the currently configured value for advanced options.  
RECONFIGURE;  
GO  
-- To enable the feature.  
EXEC sp_configure 'xp_cmdshell', 1;  
GO  
-- To update the currently configured value for this feature.  
RECONFIGURE;  
GO  

https://docs.microsoft.com/fr-fr/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option?view=sql-server-2017

Then execute code:

1
EXEC master..xp_cmdshell 'net user'; 

PS: It is enabled by default for MS SQL Server 2000