PowerShell
This function requires O&O Syspectr Premium or a higher edition. Compare the editions
Overview
With O&O Syspectr, you run PowerShell scripts on remote computers and store and evaluate their results centrally. It does not matter whether the computer is connected to your network or belongs to a particular domain or workgroup. You no longer need to store the logs of your scripts on a file server and evaluate them by hand: O&O Syspectr notifies you as soon as a script detects a problem – around the clock, seven days a week.
PowerShell scripts run in O&O Syspectr just as if you were working directly on the computer. In addition, O&O Syspectr evaluates the result of each script and runs scripts on a schedule, as you may know it from crontab on Linux – without the Windows Task Scheduler. This way you extend the monitoring of O&O Syspectr with your own checks.
Create and manage scripts
You manage your PowerShell scripts completely in the web application: create, edit, activate, deactivate and delete scripts, and see their results – from virtually anywhere. A script you have created once can be used on any of your computers. In a group, you can run a script on all its computers at once.
Evaluation of the results
At the end, each script returns a result value (exit code). It determines the status of the computer:
exit 0(or no exit code): status OK (green)exit 1: status warning (yellow)exit 2or higher: status problem (red)
In addition, O&O Syspectr stores the last output line of the script (up to 2,048 characters) in the history of the computer. You can subscribe to a notification that sends you the exit code and this output by email, so you know right away when an automated script reports a warning or a problem.
Execution of scripts
Scripts can be run:
- manually – you start the script in O&O Syspectr
- automatically at startup – the script runs each time the system starts
- automatically at specific times – you set the times with crontab syntax
Scheduling syntax
For scheduled execution, enter a line with the following five fields: [minutes] [hours] [days] [months] [weekdays]
Fields
| Field | Valid values | Notes |
|---|---|---|
| minutes | 0…59 | * for every minute | |
| hours | 0…23 | * for every hour | |
| days | 1…31 | * for every day | If you specify both days and weekdays, the script runs when either of them matches (see the last example). |
| months | 1…12 | * for every month | |
| weekdays | 0…7 | * for every weekday | 0 and 7 both stand for Sunday. |
You can also specify ranges (4-16), lists (6,7) and steps (*/15).
Examples
| [minutes] | [hours] | [days] | [months] | [weekdays] | Explanation |
|---|---|---|---|---|---|
| 10 | 0 | * | * | * | Every day at 12:10 a.m. (ten minutes past midnight). |
| 10 | 0 | * | * | 3 | Every Wednesday at 12:10 a.m. |
| 0 | * | * | * | * | Every hour on the hour. |
| */15 | 4-16 | * | * | 6,7 | Every 15 minutes from 4:00 a.m. to 4:45 p.m., but only on Saturdays and Sundays. |
| * | * | * | * | * | Every minute (the shortest possible interval). |
| * | 14 | 1-10 | 5 | 1 | Every minute from 2:00 to 2:59 p.m. on May 1 to 10 and on every Monday in May – the special case where days and weekdays are used together. |
Compatibility
Scripts run with the PowerShell installed on the computer. All current Windows versions include Windows PowerShell 5.1. PowerShell versions differ partly in syntax and functions, so make sure your scripts work with the version installed on your computers.
Script library
The script library is the central place for your PowerShell scripts. Here you edit and delete scripts, assign them to computers or remove them from computers. To create a new script, click the corresponding button. The library also shows when each script was created and last changed.
Add script
Give your scripts meaningful names. The name is only used for display; O&O Syspectr assigns the file name for the execution itself.
You enter the script in a text editor with syntax highlighting: the PowerShell keywords are shown in color. You can edit the text as in any other editor and paste scripts from the clipboard.
Under execution, you specify when the script runs on the computer:
- Manual execution – you run the script manually whenever you want.
- Manual execution – run now – as manual execution, but the script also runs once right away when you save it.
- Execution at startup – the script runs each time the system starts.
- Scheduled execution – the script runs on a schedule in crontab syntax (see above).
When you save the script, it either runs right away or is activated according to the execution you selected. Scripts with manual execution (the default) only run when you start them.