Ask the Community
Groups
Powershell as plugin monitor script - Connect IT Community | Kaseya
<main> <article class="userContent"> <h3 data-id="question"><strong>QUESTION:</strong></h3> <p>Can I use powershell to create plugin monitor script?</p> <h3 data-id="n-a"> </h3> <h3 data-id="resolution"><strong>RESOLUTION:</strong></h3> <p>Yes, you can run basic powershell scripts but you have to run it through a wrapper batch file.</p> <p>Here is the example wrapper code:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0"><a href="https://kaseya.vanillacommunities.com/profile/echo" rel="nofollow">@echo</a> off <br>rem This will create the drive, path and filename variable (e.g "C:\Program Files (x86)\Traverse\plugin\monitors\filecheck\isfile.ps1")<br>SET script=%~d0%~p0%~n0.ps1<br> rem Without the echo command below stdin seems to be held open causing powershell not to terminate echo . | c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Unrestricted "& '%script%'" %* 2> c:\users\public\dump </pre> <p> </p> <p>Attached the same example wrapper code.</p> <p>- Replace 'script' with the right script name.</p> <p>For more information about custom plugin please review:</p> <p><a title="TCP connections plugin monitor" href="https://kaseya.vanillacommunities.com/kb/articles/aliases/kaseya/entries/102273266" rel="noopener noreferrer noreferrer nofollow">TCP connections plugin monitor</a></p> <p> </p> <p><strong>APPLIES TO:</strong></p> <p>All versions of Traverse</p> </article> </main>