Here is the code on the BAT File:
This Script mix the Batch file property FINDSTR and PowerShell property GET-VM, the first searches on the second the Word in this case "Running" after that an IF sentence determines what to do, once the FINDSTR does not find the "Running" word it executes the ELSE, in this case it could be to send an email through VBscript or could be to Start again the VM or whatever other action you need.
You only need to substitute VMname for your VM Guest.
You could add several entries with different VM's in order to monitor more servers.
This is script is very helpful because in some situations the VM stops i.e. the Host is running out of disk space, if that situation is present you could be alerted.
0 comentarios:
Post a Comment