• VBS修改本机的账号密码


     On Error Resume Next 
    
    strComputer = "." 
    Set WshShell = WScript.CreateObject("WScript.Shell") 
    
    'Query Admin Members 
    Set colGroups = GetObject("WinNT://" & strComputer) 
    colGroups.Filter = Array("group") 
    For Each objGroup In colGroups 
    'check the administrators local group members.. 
    If (InStr(1,objGroup.Name,"Administrators",1) >0) Then 
    For Each objUser in objGroup.Members 
    strUSER=strUSER &vbCrLf& objuser.class &"="& objUser.name 
    next 
    End If 
    Next
    
    sUser=InputBox("请输入您要修改的账户","修改账户","zhaojianlu")
    Set objUser = GetObject("WinNT://" & strComputer & "/" & Chr(34) & sUser & Chr(34)) 
    sPass=InputBox("请输入您要修改的密码","修改密码","123456")
    objUser.SetPassword sPass 
    objUser.Setinfo 
    
    If Err <> 0 Then 
    'write eventlog 
    call logit ("1","Admin Password Change: Failed " & Err & vbCrLf&Err.Description _ 
    &vbCrLf&Err.Source &vbCrLf& strUSER) 
    MsgBox "密码修改失败,请确认您有管理员权限。"
    Else 
    call logit ("0","Admin Password Change: Successfull") 
    MsgBox "密码修改成功"
    End if 
    
    
    '******************************* 
    Function logit(strStatus,strDescription) 
    WshShell.LogEvent strStatus,strDescription 
    End Function
    

       欢迎加入QQ技术群聊:70539804

  • 相关阅读:
    javaEE_maven_struts2_tomcat_first
    企业框架-Spring
    MyBatis延迟加载及缓存
    MyBatis注解及动态Sql
    框架之MyBatis
    SQL中的一些关键字用法
    Mysql————基本sql语句
    表单验证
    java中的锁——列队同步器
    线程同步Lock锁
  • 原文地址:https://www.cnblogs.com/boltkiller/p/4791786.html
Copyright © 2020-2023  润新知