sql server创建windows账户


--不要干坏事

 

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 再把用户加为系统管理员,


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM