PowerShell

Overview

O&O Syspectr provides a very easy way to run PowerShell scripts on remote computers and store and evaluate the results centrally in O&O Syspectr. It does not matter if the computer is connected to the network or part of a specific domain or work group. The times when you had to file logs of PowerShell scripts on a file server and evaluate them laboriously is a thing of the past. O&O Syspectr monitors your systems and notifies you as soon as a script identifies a problem - 24 hours, 7 days a week. This not only saves time, money and nerves, but also a lot of money. Actually, PowerShell works in O&O Syspectr just as if you were working directly on the computer. In addition, O&O Syspectr offers the evaluation of the outcome of the PowerShell script and scheduling, as you may know from Linux crontab. This makes it possible to execute PowerShell scripts at specific times, without having to use the Windows Task Scheduler. With the help of the PowerShell scripting app, you are no longer bound to the restrictions of popular IT monitoring solutions. It is finally possible to customize and extend your wishes according to your IT monitoring!

Create and manage scripts

PowerShell scripts can be fully managed in O&O Syspectr via the web application. You can create, edit, activate and deactivate, and delete scripts. In other words, you can create, edit and see the results of a script for one of your computers from virtually anywhere in the world. Scripts that you have created once, can be applied to any other computer.

Evaluation of the results of PowerShell scripts

Each script gives provides a result value (so-called. exit code) at the end. This value influences the status of your computer and is interpreted as follows:

  • exit 0 (or no exit code was delivered): Status OK (green)
  • exit 1: Status warning (yellow)
  • exit 2 or greater: Status problem (red)

At the same time, the latest issue line of your script is up to 2,048 characters long and stored and recorded in the history of your computer. Of course, you can subscribe to an alert that sends you the exit code and that issue via mail. That way you can see see immediately, if an automated script signals a warning or an issue.

Execution of scripts

The execution of scripts is possible as follows:

  • manually - manual execution using O&O Syspectr
  • automatically at startup - at every system startup, the script runs automatically
  • automatically at specific times - the times can be set via crontab syntax

Syntax of scheduling

If the user-defined execution is enabled, the scripts can be run automatically. The line consists of the following 5 fields: [Minutes] [hours] [days] [months] [weekdays]

Definition of the fields

Field Valid values Notes
minutes 0...59 | * for every minute
hours 0...23 | * for every hour
days 1...31 | * for every day If days abd weekdays are used together, then they are evaluated together, but individually (see special case in the examples)
months 1...12 | * for every month
weekdays 0...7 | * for each weekday 0 or 7 stand for Sunday

Examples of scheduling with O&O Syspectr

[minutes] [hours] [days] [months] [Weekdays] Explanation
10 0 * * * Every day at ten minutes past midnight.
10 0 * * 3 Every Wednesday, at ten minutes past midnight.
0 * * * * Every day, every hour
*/15 4-16 * * 6.7 Every 15 minutes between 4 a.m. and 4 p.m., but only on Saturdays and Sundays.
* * * * * Every minute (minimum setting option)
* 14 1-10 5 1 In May from 1st to 10th and every Monday in May at 2 p.m.; this is a special case when days and days of the week are used together.

Compatibility

The PowerShell is available in different versions. To find out which version is installed on your system, you can investigate using O&O Syspectr in the Dashboard. Basically: - Version 1.0 is obsolete and should no longer be used.

  • Version 2.0 is installed by default in Windows 7. It can be downloaded and installed for free for Windows XP, Windows Server 2003 and Windows Vista.
  • Version 3.0 is the standard for Windows 8. They are also available for Windows 7 SP1 and Windows Server 2008 R2 SP1.
  • Version 4.0 is the latest version and can be installed as part of Windows Management Framework 4.0.

The different versions have partly different syntax and functions so that adjustments to the scripts for each version may be necessary.

Script library

The script library is the central location for your PowerShell scripts. All scripts are stored here and can be edited, deleted and assigned to computers or even revoked. If you want to create a new script, simply click on the appropriate button. You can also find information here on the creation date of scripts and when they were last edited.

Add script

Always give your scripts a descriptive name! You can choose any name you like, it will not subsequently be used as the filename for the execution of the script. This file name is assigned by the system independently.

Entering PowerShell scripts is done through a text editor. This helps you when entering a script by using a so-called Syntax Highlighting. This means that the relevant keywords of PowerShell are color highlighted. You can edit as much as you like in the way you no doubt know from other text editors, and you can also paste scripts from your clipboard or enter excerpts from your computer in the textbox.

With the execution, you determine when the script should be executed on the target machine. You have the following options:

  • Manual execution - You can run the script manually at any time
  • Manual execution – run now - You can run the script manually at any time; it will be executed once immediately when you press save
  • Execution at startup - The script runs at every system start
  • Scheduled execution - Use crontab syntax to create a schedule. For the syntax you can find a detailed description in the Help section on the main page of the PowerShell script app.

By saving the script it will either be executed immediately or activated once you select it. For manual scripts (default setting), the scripts are only executed when you explicitly request it.