ITIM WinLocal Agent部署自动化脚本

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 [email protected]"








你可能感兴趣的:(C++,c,脚本,C#,tivoli)