How to troubleshoot my Windows PowerShell Plugin?

How to troubleshoot my Windows PowerShell Plugin?

By default, the Site24x7 monitoring Windows agent will run as a SYSTEM user. In case, if you would like to verify if the plugin script is giving the output properly as SYSTEM user, follow these steps:

  1. Download PsExec from this link and extract the PSTools.zip file.

  2. Open command prompt as the administrator.

  3. Navigate to the PsExec.exe path.

  4. Execute the following command:
    psexec -i -s powershell.exe.
    This will open the PowerShell window.

  5. Execute the command whoami and check if it is running as SYSTEM user.
    If it does, then the agent is running as the SYSTEM user.

                      

  1. Now, execute the PowerShell script. If any error occurs, check if the SYSTEM user has permission to execute the script. If there is no error during execution, verify if you are getting the output in JSON format.