Stop AppSense MC Server

AppSense.AMC.8.AMC.Stop.All.Task (Task)

Agent task to Stop the AppSense MC Server

Knowledge Base article:

Summary

Stop AppSense MC Server

Agent task to Stop the AppSense MC Server

Causes

Resolutions

Element properties:

TargetAppSense.AMC.8.AMC.Server
AccessibilityInternal
CategoryMaintenance
EnabledTrue
RemotableFalse
Timeout301

Member Modules:

ID Module Type TypeId RunAs 
Script WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<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><Script><![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]]></Script></ScriptBody>
<TimeoutSeconds>301</TimeoutSeconds>
</WriteAction>
</Task>