Jump to content
TechnicalHero

Script will not run properly from a Monitor

Recommended Posts

Hi All,

I have a script that starts OneDrive. I can send the script to an agent and it works wonderfully. I then want to monitor OneDrive.exe (the process) and if it is not running, I want it to run my script to start it. I have created a Remote Monitor to look for the OneDrive process. When I kill and start the process on my laptop I can see the Monitor picking it up. All works. But I cannot get my script to run properly from the monitor. On the agent it says it has run, but OneDrive has not started. I have created an Alert Template to run the script which the Monitor is using. Any suggestions as what to check next?

Kind regards,

Share this post


Link to post
Share on other sites
10 hours ago, TechnicalHero said:

I have a script that starts OneDrive. I can send the script to an agent and it works wonderfully. I then want to monitor OneDrive.exe (the process) and if it is not running, I want it to run my script to start it. I have created a Remote Monitor to look for the OneDrive process. When I kill and start the process on my laptop I can see the Monitor picking it up. All works. But I cannot get my script to run properly from the monitor. On the agent it says it has run, but OneDrive has not started. I have created an Alert Template to run the script which the Monitor is using. Any suggestions as what to check next?

Does OneDrive.exe need to be run as the logged in/console user? It may bail when SYSTEM calls it in a non-interactive service context.

See https://gavsto.com/running-programs-scripts-as-a-logged-in-user-in-a-labtech-automate-script/

That is for a SCRIPT to run the process... A monitor runs from the agent context, as SYSTEM inside the service.  A monitor cannot launch an executable in the console session, but it can trigger an alert which calls the script which launches the application, as described above.

Share this post


Link to post
Share on other sites

Hi Darren,

It was me....I was calling the wrong script *slaps face*. Thank you for taking the time to have a look though 🙂

Kind regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×