Windows script automating (EN)

by Szymon

Posted on Mon Sep 10 14:17:51 GMT 2018

View of Cula
Automate your server monitoring on Windows! CULA

Let's say you are monitoring your PC stats such as CPU usage, memory and disk space.
It's better to do it constantly, but it's frustrating to run a script every time you turn on a computer, right?
I want to show you a simple solution: Windows Task Scheduler, it can do it for you.

Add a new server and download the script for Windows.

In case you don't know what I am talking about, check it here.

Open Windows Task Scheduler

Simply press Windows+R to open Run window and type the following: taskschd.msc Windows Task Scheduler should appear. Now, click on the "Create Task..." The Configuration window will pop up.

Setting up the automated task

On the General tab, set everything up as shown on the screen.
Important thing to note about the options:
Run only when user is logged on - will trigger a powershell window every time you log into your PC. To avoid it choose:
Run whether user is logged on or not - the task will be running in the background
A bit of a misleading naming I'll admit.
On Triggers tab, click New... button to add a new trigger. Arrange it as bellow:
On Actions tab, click New... as well. Now focus, this is the most important step.
On the following window choose:
Action: Start a program
Program/script: PowerShell.exe
Add arguments: -ExecutionPolicy Bypass pathToYourScript
In my case that is -ExecutionPolicy Bypass D:/cula_apm_script.ps1
Leave Start in blank
The whole Conditions tab should be unchecked:
As well as Settings tab:
Great! Now you can click OK.
After that, go into Task Scheduler Library and find your task.
Right click on it and choose Run.

Done! Reboot!

Now, all you have to do it to restart your computer and visit Servers tab in Cula. If everything is set up correctly, Cula will gather stats from your computer automatically!

Thank you!

Any questions?

Cula, Katowice, Poland