How do I log in as a LocalSystem user to test scripts?

To verify that custom scripts can run outside the Datto RMM environment, you must run them as a LocalSystem user. Running scripts as a regular user will not give accurate results.

  1. Go to Run and type cmd to open a command window. Open the first command prompt using the Run As option, and choose Run as administrator.

  2. Navigate to the directory where you downloaded PsExec:
  3. cd Desktop\PsTools

  4. Run the PsExec tool to invoke a new command prompt as the LocalSystem user. Commands typed in this window will be on the LocalSystem user level.
  5. psexec.exe -hsi cmd.exe

  6. In the new command window, type whoami to verify you are running as the LocalSystem user. You can now test the script.

Additional resources