Helpdesk桌面运维自动化配置工具_第1页
Helpdesk桌面运维自动化配置工具_第2页
Helpdesk桌面运维自动化配置工具_第3页
Helpdesk桌面运维自动化配置工具_第4页
Helpdesk桌面运维自动化配置工具_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、精选优质文档-倾情为你奉上精选优质文档-倾情为你奉上专心-专注-专业专心-专注-专业精选优质文档-倾情为你奉上专心-专注-专业Helpdesk_Automatic_configuration_Tool软件界面如下图:以下至文档末尾是全部代码:#cs -AutoIt Version: 3.3.14.2Author: Miguel LouisScript Function: Helpdesk_Automatic_configuration_Tool 关于Helpdesk_Automatic_configuration_ToolHelpdesk_Automatic_configuration_Too

2、l是一款Helpdesk桌面运维自动化配置的工具,由类BASIC语言的AutoIt v3 脚本编写,用于简化Helpdesk大量繁复的操作,通过GUI交互,实现以下功能,大幅解放Helpdesk桌面工程师的时间和精力,用于更高的技术学习和提升。1. 自动设置系统选项2. 客户端自动加域3. 自动安装软件4. 自动重启电脑并登录域账户5. 自动配置桌面环境6. 自动配置outlook及skype等配置说明:以下代码位于134 144行,user-defined部分请根据实际需求和场景自定义Global $rootUserName = administrator ;本地管理员administrat

3、orGlobal $rootPassword = user-defined ;本地管理员密码Global $createUserName = admin ;创建本地用户名Global $createUserPassword = user-defined ;设置本地用户名密码Global $domainName = user-defined ;AD域名,Global $itUserName = user-defined ;IT管理员域账户Global $itPassword = user-defined ;IT管理员域账户密码Global $fileSrvPath = user-defined

4、;安装文件所在的共享目录地址Global $userName ;用户域账号Global $userPassword ;用户域账户密码Global $hostName ;用户计算机名使用说明:1. 该自动化运维工具适用于Microsoft Windows 7、Windows 8、Windows 10系统,结合企业级系统部署平台MDT使用更优2. 配置选项用于根据不同部门员工的桌面使用需求自动进行系统设置、安装软件等初始化操作,需在administraor账户下运行3. 用户选项用于根据不用部门员工的桌面使用需求自动进行桌面环境配置,outlook、skype等办公软件登录设置,需在用于账户下运行

5、4. 自动重启系统+登录账户 通过授予用户本地管理员权限并修改注册表实现,在系统重启自动登录用户账户后,需运行取消自动登录 和 取消管理员权限来重置注册表并从administrators组移出用户账户5. 可根据各自公司内部的实际桌面运维需求,修改该脚本代码,从而添加、修改或删除自动化功能模块6. 所需安装的软件和工具下载放置于$fileSrvPath下,并根据存放路径和软件名称修改对应模块的代码#ce -; Script Start - Add your code below here;请求管理员权限#RequireAdmin;#include ;#include ;#include #in

6、clude #include ; 切换为 OnEvent 模式Opt(GUIOnEventMode, 1)_main()GUISetState()Func _main() Global $Checkbox53 Global $gui_width = 490 Global $gui_height = 500 Global $checkbox_left = 5 Global $sysconf_top = 10 Global $install_top = 155 Global $user_top = 375 Global $checkbox_width = 150 Global $checkbox_

7、height = 20 Global $select_left = 5 Global $select_top = 300 Global $select_width = 50 Global $select_height = 30 GUICreate(自动化配置工具 V1.0 - By Miguel Louis, $gui_width, $gui_height) GUICtrlCreateGroup(系统设置, $checkbox_left, $sysconf_top, $gui_width-10, $gui_height/3-30) $Checkbox1 = GUICtrlCreateCheck

8、box(修改计算机名并加域, $checkbox_left+5, $sysconf_top+20, $checkbox_width, $checkbox_height) $Checkbox2 = GUICtrlCreateCheckbox(修改管理员密码, $checkbox_left+160, $sysconf_top+20, $checkbox_width, $checkbox_height) $Checkbox3 = GUICtrlCreateCheckbox(创建本地用户admin, $checkbox_left+320, $sysconf_top+20, $checkbox_widt

9、h, $checkbox_height) $Checkbox4 = GUICtrlCreateCheckbox(添加IT管理员组, $checkbox_left+5, $sysconf_top+50, $checkbox_width, $checkbox_height) $Checkbox5 = GUICtrlCreateCheckbox(开启远程桌面, $checkbox_left+160, $sysconf_top+50, $checkbox_width, $checkbox_height) $Checkbox6 = GUICtrlCreateCheckbox(安装AD证书, $check

10、box_left+320, $sysconf_top+50, $checkbox_width, $checkbox_height) $Checkbox7 = GUICtrlCreateCheckbox(激活Office, $checkbox_left+5, $sysconf_top+80, $checkbox_width, $checkbox_height) $Checkbox8 = GUICtrlCreateCheckbox(降低UAC等级, $checkbox_left+160, $sysconf_top+80, $checkbox_width, $checkbox_height) GUI

11、CtrlCreateGroup(软件安装, $checkbox_left, $install_top, $gui_width-10, $gui_height/3-30) $Checkbox21 = GUICtrlCreateCheckbox(Adobe Flash Player, $checkbox_left+5, $install_top+20, $checkbox_width, $checkbox_height) $Checkbox22 = GUICtrlCreateCheckbox(Google Chrome, $checkbox_left+160, $install_top+20, $

12、checkbox_width, $checkbox_height) $Checkbox23 = GUICtrlCreateCheckbox(LinPhone for Windows, $checkbox_left+320, $install_top+20, $checkbox_width, $checkbox_height) $Checkbox24 = GUICtrlCreateCheckbox(Cisco VPN Client, $checkbox_left+5, $install_top+50, $checkbox_width, $checkbox_height) $Checkbox25

13、= GUICtrlCreateCheckbox(Minerva Pro, $checkbox_left+160, $install_top+50, $checkbox_width, $checkbox_height) $Checkbox26 = GUICtrlCreateCheckbox(Avaya one-X, $checkbox_left+320, $install_top+50, $checkbox_width, $checkbox_height) $Checkbox27 = GUICtrlCreateCheckbox(Teamviewer11to10, $checkbox_left+5

14、, $install_top+80, $checkbox_width, $checkbox_height) $Checkbox28 = GUICtrlCreateCheckbox(Teamviewer10, $checkbox_left+160, $install_top+80, $checkbox_width, $checkbox_height) GUICtrlCreateGroup(配置选项,$select_left, $select_top, $gui_width-10, $gui_height/3-100) Global $Radio1 = GUICtrlCreateRadio(销售,

15、 $select_left+5, $select_top+20, $select_width, $select_height) Global $Radio2 = GUICtrlCreateRadio(销售(含VPN), $select_left+55, $select_top+20, $select_width+40, $select_height) Global $Radio3 = GUICtrlCreateRadio(运营, $select_left+150, $select_top+20, $select_width, $select_height) Global $Radio4 = G

16、UICtrlCreateRadio(售后, $select_left+200, $select_top+20, $select_width, $select_height) GUICtrlCreateGroup(用户选项,$select_left, $user_top, $gui_width-10, $gui_height/3-100) $Checkbox43 = GUICtrlCreateCheckbox(销售, $checkbox_left+5, $user_top+20, $checkbox_width-100, $checkbox_height+10) $Checkbox44 = GU

17、ICtrlCreateCheckbox(运营, $checkbox_left+65, $user_top+20, $checkbox_width-100, $checkbox_height+10) $Checkbox45 = GUICtrlCreateCheckbox(售后, $checkbox_left+135, $user_top+20, $checkbox_width-100, $checkbox_height+10) $Checkbox41 = GUICtrlCreateCheckbox(取消自动登录, $checkbox_left+205, $user_top+20, $checkb

18、ox_width-50, $checkbox_height+10) $Checkbox42 = GUICtrlCreateCheckbox(取消管理员权限, $checkbox_left+305, $user_top+20, $checkbox_width-50, $checkbox_height+10) $Checkbox51 = GUICtrlCreateCheckbox(自动重启系统+登录账户, $select_left+90, $user_top+85, $select_width+100, $select_height) Global $Radio11 = GUICtrlCreate

19、Radio(全选, $select_left+260, $user_top+85, $select_width, $select_height) Global $Radio12 = GUICtrlCreateRadio(全不选, $select_left+320, $user_top+85, $select_width+10, $select_height) Global $Button1 = GUICtrlCreateButton(运行 (&A), $select_left, $user_top+80, $select_width+20, $select_height) Global $Bu

20、tton2 = GUICtrlCreateButton(退出 (&E), $select_left+410, $user_top+80, $select_width+20, $select_height) GUICtrlSetOnEvent($Radio1,_chooseStation) GUICtrlSetOnEvent($Radio2,_chooseStationWithVPN) GUICtrlSetOnEvent($Radio3,_chooseCreditAduit) GUICtrlSetOnEvent($Radio4,_chooseCollection) GUICtrlSetOnEve

21、nt($Radio11,_chooseAll) GUICtrlSetOnEvent($Radio12,_chooseNone) GUICtrlSetOnEvent($Checkbox43,_userStation) GUICtrlSetOnEvent($Checkbox44,_userCreditAduit) GUICtrlSetOnEvent($Checkbox45,_userCollection) GUICtrlSetOnEvent($Button1,_action) GUICtrlSetOnEvent($Button2,_exit) GUISetOnEvent($GUI_EVENT_CL

22、OSE,_exit) Global $_run53 $_run1 = _run1 ;修改计算机名并加域 $_run2 = _run2;修改管理员密码 $_run3 = _run3 ;创建Admin用户 $_run4 = _run4;添加IT服务台 $_run5 = _run5 ;开启远程桌面 $_run6 = _run6 ;安装AD证书 $_run7 = _run7;激活Office $_run8 = _run8;降低UAC等级 $_run21 = _run21 ;安装Adobe Flash Player $_run22 = _run22 ;安装Google Chrome $_run23 =

23、_run23 ;安装LinPhone for Windows $_run24 = _run24 ;安装Cisco VPN Client $_run25 = _run25 ;安装Minerva Pro $_run26 = _run26 ;安装Avaya one-X $_run27 = _run27 ;卸载TeamViewer11,安装TeamViewer10 $_run28 = _run28 ;安装TeamViewer10 $_run41 = _run41 ;取消自动登录 $_run42 = _run42 ;取消管理员权限 $_run43 = _run43 ;销售用户配置 $_run44 = _

24、run44 ;运营用户配置 $_run45 = _run45 ;售后用户配置 $_run51 = _run51 ;自动重启系统 Global $rootUserName = administrator ;本地管理员administrator Global $rootPassword = user-defined ;本地管理员密码 Global $createUserName = admin ;创建本地用户名 Global $createUserPassword = user-defined ;设置本地用户名密码 Global $domainName = user-defined ;AD域名,

25、Global $itUserName = user-defined ;IT管理员域账户 Global $itPassword = user-defined ;IT管理员域账户密码 Global $fileSrvPath = user-defined ;安装文件所在的共享目录地址 Global $userName;用户域账号 Global $userPassword ;用户域账户密码 Global $hostName ;用户计算机名EndFuncWhile 1 sleep(1000)WEnd;关闭程序Func _exit() ExitEndFunc;销售Func _chooseStation()

26、 For $i = 1 to 52 GUICtrlSetState($Checkbox$i,4) Next GUICtrlSetState($Checkbox1,1) GUICtrlSetState($Checkbox2,1) GUICtrlSetState($Checkbox3,1) GUICtrlSetState($Checkbox4,1) GUICtrlSetState($Checkbox5,1) GUICtrlSetState($Checkbox6,1) GUICtrlSetState($Checkbox7,1) GUICtrlSetState($Checkbox21,1) GUICt

27、rlSetState($Checkbox51,1) GUICtrlSetState($Radio11,4) GUICtrlSetState($Radio12,4)EndFunc;销售(含VPN)Func _chooseStationWithVPN() For $i = 1 to 52 GUICtrlSetState($Checkbox$i,4) Next GUICtrlSetState($Checkbox1,1) GUICtrlSetState($Checkbox2,1) GUICtrlSetState($Checkbox3,1) GUICtrlSetState($Checkbox4,1) G

28、UICtrlSetState($Checkbox5,1) GUICtrlSetState($Checkbox6,1) GUICtrlSetState($Checkbox7,1) GUICtrlSetState($Checkbox21,1) GUICtrlSetState($Checkbox24,1) GUICtrlSetState($Checkbox51,1) GUICtrlSetState($Radio11,4) GUICtrlSetState($Radio12,4)EndFunc;运营Func _chooseCreditAduit() For $i = 1 to 52 GUICtrlSet

29、State($Checkbox$i,4) Next GUICtrlSetState($Checkbox1,1) GUICtrlSetState($Checkbox2,1) GUICtrlSetState($Checkbox4,1) GUICtrlSetState($Checkbox5,1) GUICtrlSetState($Checkbox6,1) GUICtrlSetState($Checkbox7,1) GUICtrlSetState($Checkbox21,1) GUICtrlSetState($Checkbox23,1) GUICtrlSetState($Checkbox51,1) G

30、UICtrlSetState($Radio11,4) GUICtrlSetState($Radio12,4)EndFunc;售后Func _chooseCollection() For $i = 1 to 52 GUICtrlSetState($Checkbox$i,4) Next GUICtrlSetState($Checkbox1,1) GUICtrlSetState($Checkbox2,1) GUICtrlSetState($Checkbox4,1) GUICtrlSetState($Checkbox5,1) GUICtrlSetState($Checkbox6,1) GUICtrlS

31、etState($Checkbox7,1) GUICtrlSetState($Checkbox8,1) GUICtrlSetState($Checkbox21,1) GUICtrlSetState($Checkbox25,1) GUICtrlSetState($Checkbox26,1) GUICtrlSetState($Checkbox51,1) GUICtrlSetState($Radio11,4) GUICtrlSetState($Radio12,4)EndFunc;选中“销售用户配置”同时选中“安装Google ChromeFunc _userStation() If _GUICtrl

32、Button_GetCheck($Checkbox43) Then GUICtrlSetState($Checkbox41,1) GUICtrlSetState($Checkbox42,1) EndIfEndFunc;选中“运营用户配置”同时选中“安装Google ChromeFunc _userCreditAduit() If _GUICtrlButton_GetCheck($Checkbox44) Then GUICtrlSetState($Checkbox22,1) GUICtrlSetState($Checkbox41,1) GUICtrlSetState($Checkbox42,1)

33、 EndIfEndFunc;选中“售后用户配置”同时选中“安装Google ChromeFunc _userCollection() If _GUICtrlButton_GetCheck($Checkbox45) Then GUICtrlSetState($Checkbox41,1) GUICtrlSetState($Checkbox42,1) EndIfEndFunc;全选Func _chooseAll() For $i = 1 to 40 GUICtrlSetState($Checkbox$i,1) Next For $i = 41 to 46 GUICtrlSetState($Check

34、box$i,4) Next GUICtrlSetState($Checkbox51,1) GUICtrlSetState($Radio1,4) GUICtrlSetState($Radio2,4) GUICtrlSetState($Radio3,4) GUICtrlSetState($Radio4,4) GUICtrlSetState($Radio12,4)EndFunc;全不选Func _chooseNone() For $i = 1 to 52 GUICtrlSetState($Checkbox$i,4) Next GUICtrlSetState($Radio1,4) GUICtrlSet

35、State($Radio2,4) GUICtrlSetState($Radio3,4) GUICtrlSetState($Radio4,4) GUICtrlSetState($Radio11,4)EndFunc;运行Func _action() For $i = 1 to 52 If _GUICtrlButton_GetCheck($Checkbox$i) Then $_run$i() EndIf NextEndFunc;用户配置Func _userConf() Run(C:Program FilesMicrosoft OfficeOffice16OUTLOOK.EXE) WinWaitAct

36、ive(欢迎使用 Microsoft Outlook 2016,欢迎使用 Outlook 2016) SLEEP(0 xF4) Send(!n) WinWaitActive(Microsoft Outlook 账户设置,使用 Outlook 连接到电子邮件帐户) SLEEP(0 xF4) Send(!n) WinWaitActive(添加帐户,电子邮件帐户(&A) SLEEP(0 xE8) Send(!n) SLEEP(0 xD0) If WinExists(安全警告) Then ;如果提示未安装域证书则自动进行安装 If IsAdmin() Then WinMinimizeAll() Run

37、(explorer $fileSrvPathADCA.cer) WinWaitActive(证书,证书信息) SLEEP(0 xF4) Send(!i) WinWaitActive(证书导入向导,欢迎使用证书导入向导) SLEEP(0 xF4) Send(!n) WinWaitActive(证书导入向导,证书存储是保存证书的系统区域) SLEEP(0 xF4) Send(!p) SLEEP(0 xF4) Send(!r) WinWaitActive(选择证书存储,选择要使用的证书存储) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) ControlClick(选择证书

38、存储,选择要使用的证书存储,Button1,left,1) WinWaitActive(证书导入向导,证书存储是保存证书的系统区域) SLEEP(0 xF4) Send(!n) WinWaitActive(证书导入向导,正在完成证书导入向导) SLEEP(0 xF4) ControlClick(证书导入向导,正在完成证书导入向导,Button6,left,1) Local $i = 0 While $i = 3000If WinExists(安全性警告) Then WinActivate(安全性警告,您即将从一个声称代表如下的证书颁发机构安装证书) WinWaitActive(安全性警告,您即

39、将从一个声称代表如下的证书颁发机构安装证书) SLEEP(0 xF4) Send(!y)Else SLEEP(0 xE8) $i = $i + 1000EndIf WEnd WinActivate(证书导入向导,导入成功) WinWaitActive(证书导入向导,导入成功) SLEEP(0 xF4) ControlClick(证书导入向导,导入成功,Button1,left,1) WinWaitActive(证书,证书信息) SLEEP(0 xF4) Send(!i) WinWaitActive(证书导入向导,欢迎使用证书导入向导) SLEEP(0 xF4) Send(!n) WinWait

40、Active(证书导入向导,证书存储是保存证书的系统区域) SLEEP(0 xF4) Send(!p) SLEEP(0 xF4) Send(!r) WinWaitActive(选择证书存储,选择要使用的证书存储) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) ControlClick(选择证书存储,选择要使用的证书存储,Button1,left,1) WinWaitActive(证书导入向导,证书存储是保存证书的系统区域)

41、SLEEP(0 xF4) Send(!n) WinWaitActive(证书导入向导,正在完成证书导入向导) SLEEP(0 xF4) ControlClick(证书导入向导,正在完成证书导入向导,Button6,left,1) WinWaitActive(证书导入向导,导入成功) SLEEP(0 xF4) ControlClick(证书导入向导,导入成功,Button1,left,1) WinWaitActive(证书,证书信息) SLEEP(0 xF4) ControlClick(证书,证书信息,Button5,left,1) WinWaitClose(证书,证书信息) Else RunA

42、s($rootUserName,ComputerName,$rootPassWord,0,certutil -addstore -f Root $fileSrvPathADCA.cer,) EndIf WinActivate(安全警告) WinWaitActive(安全警告) SLEEP(0 xF4) Send(!y) WinWaitActive(添加帐户,恭喜您! 您的电子邮件帐户已成功配置并已准备就绪) SLEEP(0 xF4) ControlClick(添加帐户,恭喜您! 您的电子邮件帐户已成功配置并已准备就绪,Button9,left,1) ElseIf WinExists(添加帐户,

43、恭喜您! 您的电子邮件帐户已成功配置并已准备就绪) Then WinActivate(添加帐户,恭喜您! 您的电子邮件帐户已成功配置并已准备就绪) WinWaitActive(添加帐户,恭喜您! 您的电子邮件帐户已成功配置并已准备就绪) SLEEP(0 xF4) ControlClick(添加帐户,恭喜您! 您的电子邮件帐户已成功配置并已准备就绪,Button9,left,1) EndIf WinWaitActive(TeamViewer会议插件) SLEEP(0 xF4) Send(ENTER) WinWaitClose(TeamViewer会议插件) WinWaitActive(首要事项)

44、 SLEEP(0 xF4) Send(!l) SLEEP(0 xF4) Send(!a) SLEEP(0 xF4) WinMinimizeAll() SLEEP(0 xF4) Run(C:Program FilesMicrosoft OfficeOffice16lync.exe) WinWaitActive(Skype for Business,查找联系人或聊天室) Exit #cs SLEEP(0 xE8) If WinExists(快速提示) Then WinClose(快速提示) WinWaitClose(快速提示) EndIf SLEEP(0 xE8) If WinExists(Sky

45、pe for Business,关闭程序) Then WinActivate(Skype for Business,关闭程序) WinWaitActive(Skype for Business,关闭程序) SLEEP(0 xF4) Send(!c) WinWaitClose(Skype for Business,关闭程序) Else Exit EndIf #ceEndFunc;自动登录域账户Func _autoLogin() WinMinimizeAll() If IsAdmin() Then If $userName = Then Global $userName = InputBox(输入

46、,请输入用户名:,) Global $userPassword = InputBox(输入,请输入密码:,) EndIf ShellExecute(SystemDir & compmgmt.msc) WinWaitActive(计算机管理,计算机管理(本地) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(RIGHT) SLEEP(0 xF4) Send(DOWN) S

47、LEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(TAB) SLEEP(0 xF4) Send(ENTER) WinWaitActive(Administrators 属性,常规) SLEEP(0 xF4) Send(!d) WinWaitActive(选择用户、计算机、服务帐户或组,选择此对象类型(&S):) SLEEP(0 xF4) ControlSetText(选择用户、计算机、服务帐户或组,选择此对象类型(&S):,RichEdit20W1,$userName) SLEEP(0 xF4) Send(!c) WinWaitActive(Windows 安全

48、) SLEEP(0 xF4) ControlSetText(Windows 安全,Edit1,$itUserName) SLEEP(0 xF4) ControlSetText(Windows 安全,Edit2,$itPassword) SLEEP(0 xF4) ControlClick(Windows 安全,Button2,left,1) WinWaitActive(选择用户、计算机、服务帐户或组,选择此对象类型(&S):) SLEEP(0 xF4) ControlClick(选择用户、计算机、服务帐户或组,选择此对象类型(&S):,Button5,left,1) WinWaitActive(

49、Administrators 属性,常规) SLEEP(0 xF4) ControlClick(Administrators 属性,常规,Button3,left,1) WinActivate(计算机管理,本地用户和组组) WinWaitActive(计算机管理,本地用户和组组) SLEEP(0 xF4) WinClose(计算机管理,本地用户和组组) WinWaitClose(计算机管理,计算机管理(本地) SLEEP(0 xF4) RegWrite(HKEY_LOCAL_MACHINE64SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon,

50、AutoAdminLogon, REG_SZ, 1) RegWrite(HKEY_LOCAL_MACHINE64SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon, DefaultDomainName, REG_SZ, $domainName) RegWrite(HKEY_LOCAL_MACHINE64SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon, DefaultUserName, REG_SZ, $userName) RegWrite(HKEY_LOCAL_MACHINE64SOFTWARE

51、MicrosoftWindows NTCurrentVersionWinlogon, Defaultpassword, REG_SZ, $userPassword) Else ;RunAs($rootUserName,ComputerName,$rootPassword,0,ShellExecute(SystemDir & compmgmt.msc) MsgBox(64,警告,当前用户无权操作本地管理员组!,2) EndIfEndFunc;自动重启Func _autoReboot() WinMinimizeAll() MsgBox(64,提示,已完成初始化配置!系统将自动重启!,3) Shut

52、down(6)EndFunc;修改计算机名并加域Func _run1() WinMinimizeAll() SLEEP(0 xE8) Global $userName = InputBox(输入,请输入用户名:,) Global $userPassword = InputBox(输入,请输入密码:,) Global $hostName = InputBox(输入,请输入计算机名:,) If IsAdmin() Then Run(control sysdm.cpl) Else RunAs($rootUserName,ComputerName,$rootPassword,0,control sys

53、dm.cpl) EndIf WinWaitActive(系统属性,计算机名) SLEEP(0 xF4) Send(!c) WinWaitActive(计算机名/域更改,计算机名(&C):) SLEEP(0 xF4) WinActivate(计算机名/域更改,计算机名(&C):) ControlSetText(计算机名/域更改,计算机名(&C):,Edit1,$hostName) SLEEP(0 xF4) ControlCommand(计算机名/域更改,计算机名(&C):,Button3,Check) SLEEP(0 xF4) ControlSetText(计算机名/域更改,计算机名(&C):,

54、Edit3,$domainName) SLEEP(0 xF4) ControlClick(计算机名/域更改,计算机名(&C):,Button6,left,1) WinWaitActive(Windows 安全) SLEEP(0 xF4) ControlSetText(Windows 安全,Edit1,$itUserName) SLEEP(0 xF4) ControlSetText(Windows 安全,Edit2,$itPassword) SLEEP(0 xF4) ControlClick(Windows 安全,Button2,left,1) WinWaitActive(计算机名/域更改,欢迎

55、加入) SLEEP(0 xF4) ControlClick(计算机名/域更改,欢迎加入,Button1,left,1) Local $i = 0 While $i = 8000 If WinExists(计算机名/域更改,帐户名与安全标识间无任何映射完成) Then WinActivate(计算机名/域更改,帐户名与安全标识间无任何映射完成) WinWaitActive(计算机名/域更改,帐户名与安全标识间无任何映射完成) SLEEP(0 xF4) Send(ENTER) ExitLoop Else SLEEP(0 xE8) $i = $i + 1000 EndIf WEnd WinWaitA

56、ctive(计算机名/域更改,确定) SLEEP(0 xF4) Send(ENTER) WinWaitActive(系统属性,计算机名) SLEEP(0 xF4) ControlClick(系统属性,计算机名,Button3,left,1) WinWaitActive(Microsoft Windows) SLEEP(0 xF4) Send(!l) WinWaitClose(Microsoft Windows)EndFunc;修改本地管理员密码Func _run2() WinMinimizeAll() If IsAdmin() Then Run(net user administrator &

57、 $rootPassword) SLEEP(0 xE8) Else RunAs($rootUserName,ComputerName,$rootPassword,0,net user administrator & $rootPassword,) SLEEP(0 xE8) EndIfEndFunc;创建admin用户Func _run3() WinMinimizeAll() If IsAdmin() Then Run(net user & $createUserName & & $createUserPassword & /add) Run(net localgroup users & $cr

58、eateUserName & /add) ShellExecute(SystemDir & compmgmt.msc) WinWaitActive(计算机管理,计算机管理(本地) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(RIGHT) SLEEP(0 xF4) Send(DOWN) SLEEP(0 xF4) Send(TAB) SLEEP(0 xF4) Send(

59、ENTER) WinWaitActive(admin 属性,常规) SLEEP(0 xF4) ControlCommand(admin 属性,常规,Button2,Check,) SLEEP(0 xF4) ControlCommand(admin 属性,常规,Button3,Check,) SLEEP(0 xF4) ControlClick(admin 属性,常规,Button6,left,1) WinActivate(计算机管理,计算机管理(本地) WinWaitActive(计算机管理,计算机管理(本地) SLEEP(0 xF4) WinClose(计算机管理,计算机管理(本地) WinW

60、aitClose(计算机管理,计算机管理(本地) Else ;RunAs($rootUserName,ComputerName,$rootPassword,0,net user admin Password1 /add /passwordchg:no,) ;RunAs($rootUserName,ComputerName,$rootPassword,0,net localgroup users admin /add,) ;RunAs($rootUserName,ComputerName,$rootPassword,0,ShellExecute(SystemDir & compmgmt.msc)

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论