ITIM WinLocal Agent部署自动化脚本

VBS脚本配置工具
本工具为VBS脚本实现的自动配置程序,适用于除Vista和Win7外的Windows版本。通过运行一系列预设命令,实现服务停止与启动、证书安装等功能。

VBS脚本,其中的证书和注册表文件需要的人可以向我邮件、MSN获取。本版本适用除Vista和Win7以外的Windows版本

'Set the variables needed
Set WshShell=WScript.CreateObject("WScript.Shell")

WshShell.Run "cmd /C copy reg.exe c:\", 2, FALSE
WScript.Sleep 1000
Dim TimeInterval,ServiceName,P12File,CACert
TimeInterval="00:00:12:00:00"
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

MsgBox "Please Do NOT click the mouse during the installation!",48,"AutoConfigureTool By pchuang(53002)"

WshShell.Run "cmd /C c:\reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Access360 /f", 2, FALSE
WScript.Sleep 1000
WshShell.Run "cmd /C regedit /s autoconfig.reg", 2, FALSE
WScript.Sleep 1000
WshShell.Run "sc stop ""Tivoli Windows Local Account Adapter"" ",2,FALSE
WScript.Sleep 5000
WshShell.Run "sc start ""Tivoli Windows Local Account Adapter"" ",2,FALSE
WScript.Sleep 1000

Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd /C C:\Tivoli\Agents\WinLocalAgent\bin\agentCfg -agent WinLocalAgent", 2, FALSE
WScript.Sleep 1000
WshShell.SendKeys "agent~" 'Enter the configuration program

WshShell.SendKeys "C" 'Configure the event notification
WshShell.SendKeys "HAB" 'Modify a context for event notification
WshShell.SendKeys "erurl=https://"
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
URL=IPConfig.IPAddress(i)
Next
End If
Next

WshShell.SendKeys URL
WshShell.SendKeys ":45580~"
WScript.Sleep 1000
WshShell.SendKeys "XXX" 'Quit to the main menu
WshShell.SendKeys "BCAA" 'set the username
WshShell.SendKeys "tim_agent_1357~"
WshShell.SendKeys "tim_agent_1357~"
WshShell.SendKeys "B" 'set the username
WshShell.SendKeys "tim_passw0rd_1356~"
WshShell.SendKeys "tim_passw0rd_1356~"
WshShell.SendKeys "XXX" 'Quit to the main menu
WshShell.SendKeys "CAX" 'Disable the event notification
WshShell.SendKeys "D" 'Change Configuration Key
WshShell.SendKeys "tim_config_1355~"
WScript.Sleep 1000
WshShell.SendKeys "tim_config_1355~"

WshShell.Run "cmd /C C:\Tivoli\Agents\WinLocalAgent\bin\CertTool -agent WinLocalAgent", 2, FALSE
WScript.Sleep 1000
WshShell.SendKeys "C~" 'Install certificate and key from P12
Wshshell.SendKeys "ssl.p12~" 'Specify the P12 file
Wshshell.SendKeys "passw0rd~" 'Input the password of the P12 file
WScript.Sleep 1000
WshShell.SendKeys "F~" 'Install a CA certificate
Wshshell.SendKeys "ssl.der~" 'Specily the CA file
WshShell.SendKeys "Y~" 'confirm the information the certificate contains
WshShell.SendKeys "X~" 'Quit the CertTool

WshShell.Run "net stop ""Tivoli Windows Local Account Adapter"" ",2,FALSE
WScript.Sleep 5000
WshShell.Run "net start ""Tivoli Windows Local Account Adapter"" ",2,FALSE

MsgBox "Configuration done!",0,"AutoConfigureTool By pchuang@cn.ibm.com"








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值