Using scripts with MonitorpackMonitorpack allows you to call a file to respond to an alarm and trigger a procedure. In all cases Monitorpack only calls batch files. We recommend using by default batch files, or to call your vbs files, PowerShell, etc... from a bacth file. The scripts subfolder of the Monitorpack Guard folder has limited access rights, by default you cannot not create files. We recommend that you run the scripts from this folder but generate the outputs of your queries in a folder where you have full rights to write, delete and modify. Remember that this is the service account used by Monitorpack and which will actually run your scripts it is therefore to this account that you must give the rights. Elevation of execution rights is something to consider when using PowerShell files refer to Microsoft TechNet for more information. |
@echo off @echo off This script is only valid in a workgroup context because in this case it is necessary to have the same account service with the same password on all machines, So do not use this script in an Active Directory forest since it is enough to create the account once at the Active Directory forest level ' Name of the script : CreateMonitorpackAdminUsers.vbs Run this script on all target machines you want to control. For your information, service WinRM is not required but can be useful if you are running Remote PowerShell scripts. 'Copyrigth Monitorpack 2003 -2023 To restart or start a Windows service from a remote machine using a script, while taking into account security constraints, PsExec is a robust and secure. PsExec is a utility from Microsoft's Sysinternals suite that allows you to execute processes remotely. Download PsExec from the official website, unzip the file and place psexec.exe in a directory accessible via the PATH environment variable or in the same directory as your batch script. Replace RemoteMachineName and ServiceName with the appropriate values. Save the file with a .bat extension (for example, manage_service.bat). Create a script-type Monitorpack alert and select the bath file to execute in the event of an alarm. Start a Windows service@echo off Stop and restart a Windows service@echo off |