Objective
There are several scenarios where scheduled tasks need to be set up on Windows devices to run automation scripts at defined intervals or triggers. In this use case, we walk through creating a custom scheduled task that runs a PowerShell script — converted into an executable (.exe) — using Software Deployment combined with the Add Scheduled Program feature.
Overview of the Process
To achieve this setup, follow these key steps:
Convert PowerShell Script to EXE
Use a utility like PS2EXE or IExpress to convert your PowerShell script (.ps1
) into a.exe
file.
In this example, we converted a script that retrieves Windows Update logs (Get-WindowsUpdateLog.ps1
) into an executable.Deploy the Executable via Software Deployment
Go to EM > Actions > Software Deployment
Upload and assign the
.exe
file to target systemsDeploy the file across your selected endpoints
Schedule Execution via “Add Scheduled Program”
Navigate to EM > Actions >Startup Programs > Add Scheduled Program
Select the deployed
.exe
file(ie the path to where you have deployed)Define the schedule, trigger (e.g., Daily, at a specific time), and optional conditions (e.g., Run whether user is logged on or not)
Creation of the scheduled task via the EM console
Example Use Case
Script Functionality:
We used a PowerShell script that generates WindowsUpdate.log
. After converting it to EXE and deploying it:
The EXE was successfully triggered via a scheduled task
The expected logs were generated on the target device
This confirms the EXE ran successfully in the scheduled time slot
Output from the task execution, confirming log generation
Conclusion
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article