Agent task to Stop the AppSense MC Server
Stop AppSense MC Server
Agent task to Stop the AppSense MC Server
Target | AppSense.AMC.8.AMC.Server |
Accessibility | Internal |
Category | Maintenance |
Enabled | True |
Remotable | False |
Timeout | 301 |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
Script | WriteAction | Microsoft.Windows.ScriptWriteAction | Default |
<Task ID="AppSense.AMC.8.AMC.Stop.All.Task" Accessibility="Internal" Enabled="true" Target="AppSense.AMC.8.AMC.Server" Timeout="301" Remotable="true">
<Category>Maintenance</Category>
<WriteAction ID="Script" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>AMCStopAllServices.vbs</ScriptName>
<Arguments/>
<ScriptBody> <![CDATA['Stop AppSense Management Center Server 8 Processes
SetLocale("en-us")
'Stop IIS Application Pools
Set objDplyPool = GetObject ("IIS://Localhost/W3SVC/AppPools/DeploymentPool")
Set objDldPool = GetObject ("IIS://Localhost/W3SVC/AppPools/DownloadsPool")
Set objMgmtSvrPool = GetObject ("IIS://Localhost/W3SVC/AppPools/ManagementServerPool")
WScript.Echo "Stopping Management Server IIS Application Pool..."
objMgmtSvrPool.Stop
WScript.Echo "Stopping Downloads IIS Application Pool..."
objDldPool.Stop
WScript.Echo "Stopping Deployment IIS Application Pool..."
objDplyPool.Stop
'Stop AppSense Alerts Service
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colAlertSvc = objWMIService.ExecQuery("Select * from Win32_Service Where Name ='AppSense Alerts Service'")
For Each objAlertSvc in colAlertSvc
Wscript.Echo "Stopping AppSense Alerts Service..."
objAlertSvc.StopService()
Next
'Stop AppSense Event Dispatcher Service
Set colEVDSvc = objWMIService.ExecQuery("Select * from Win32_Service Where Name ='AppSense Events Dispatcher Service'")
For Each objEVDSvc in ColEVDSvc
Wscript.Echo "Stopping AppSense Events Dispatcher Service..."
objEVDSvc.StopService()
Next
'Stop AppSense Deployment Service
Set colEVDSvc = objWMIService.ExecQuery("Select * from Win32_Service Where Name ='AppSense Deployment Service'")
For Each objEVDSvc in ColEVDSvc
Wscript.Echo "Stopping AppSense Deployment Service..."
objEVDSvc.StopService()
Next
'Stop AppSense Scheduler Service
Set colEVDSvc = objWMIService.ExecQuery("Select * from Win32_Service Where Name ='AppSense Scheduler Service'")
For Each objEVDSvc in ColEVDSvc
Wscript.Echo "Stopping AppSense Scheduler Service..."
objEVDSvc.StopService()
Next]]> </ScriptBody>
<TimeoutSeconds>301</TimeoutSeconds>
</WriteAction>
</Task>