How do I log in as a system user to test scripts locally?
- Datto RMM
To verify that custom scripts can run outside the Datto RMM environment, you must run them as a local system 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. Run the PsExec tool to invoke a new command prompt as the local system user. Commands typed in this window will be on the local system user level.
psexec.exe -hsi cmd.exe
4. In the new command window, type whoami to verify you are running as the local system user. You can now test the script.