zoukankan      html  css  js  c++  java
  • 通过sqlserver sa密码修改windows操作系统密码

    如果你不记得windows管理员的密码了,但知道sqlserver sa用户的密码,可以通过以下方式修改:

    进入SQL之后执行以下语句:

    -- 允许配置高级选项  
    EXEC sp_configure 'show advanced options', 1  
    -- 重新配置  
    RECONFIGURE  
    -- 启用xp_cmdshell  
    EXEC sp_configure 'xp_cmdshell',1  
    --重新配置  
    RECONFIGURE 


    --新建用户名abc,密码pwd的用户

    exec master..xp_cmdshell 'net user 用户名 密码'

    exec master..xp_cmdshell 'net user administrator 123'

    -- 允许配置高级选项  
    EXEC sp_configure 'show advanced options', 1  
    -- 重新配置  禁止使用'xp_cmdshell'
    RECONFIGURE  
    -- 启用xp_cmdshell  
    EXEC sp_configure 'xp_cmdshell',0  
    --重新配置  
    RECONFIGURE 

  • 相关阅读:
    CF359B Permutation
    CF859C Pie Rules
    Contest 156
    Contest 155
    Range Module
    python-环境
    Git 使用
    Contest 154
    生命是一种长期而持续的累积过程
    Contest 153
  • 原文地址:https://www.cnblogs.com/ycdx2001/p/4447203.html
Copyright © 2011-2022 走看看