Configure startup and shutdown triggers for scripted tasks 编辑

October 13, 2022 Contributed by:  C

Configure startup and shutdown triggers for scripted tasks

As an administrator, you might want to perform system-level tasks such as configuration or cleanup tasks when the operating system starts or shuts down.

Workspace Environment Management (WEM) provides you with machine startup and shutdown triggers that you can associate with scripted tasks. The tasks are triggered to run when the operating system starts or shuts down.

A general workflow to achieve the goal is as follows:

  1. Add scripted tasks

  2. Associate startup and shutdown triggers with scripted tasks

  3. View task execution reports


Prerequisites

Before you start, make sure that:

  • Fast startup is turned off for the target machines. Example: for Windows 10 machines, go to Control Panel > All Control Panel Items > Power Options > System Settings and disable the Turn on fast startup option. The option affects only startup processing.

    Turn off Windows fast startup

  • The scripted tasks are signed with trusted certificates and the certificates are installed on the target machines.


Recommendation

We recommend that you sign the scripted tasks with trusted certificates.


Add scripted tasks

The following information is a supplement to the guidance in Scripted Tasks
. Follow the general guidance in that article and mind the details below.

This example adds two scripted tasks:

  • Task 1: startupscript - Includes scripts to run on startup.
  • Task 2: shutdownscript - Includes scripts to run on shutdown.

Tip:

You can combine the two scripts into one so that you just need to add a single task.

  1. In Web Console > Scripted Tasks, first add the startupscript task as follows:

    Add startup script

    In this example:

    • For File type, select PowerShell.
    • Browse to the PowerShell file to upload it.
    • For Grant permissions, select Full access.
  2. Repeat step 1 to add the shutdownscript task.


Associate startup and shutdown triggers with scripted tasks

The following information is a supplement to the guidance in Scripted Task Settings
. Follow the general guidance in that article and mind the details below.

Go to the relevant configuration set, navigate to Scripted Tasks Settings, and configure the two tasks as follows:

  • In Triggers, select Machine startup for the startupscript task and select Machine shutdown for the shutdownscript task.

    Configure scripted task

For your changes to take effect immediately, go to Monitoring > Administration > Agents and select Refresh agent host settings.


View task execution reports

After the tasks run successfully, you can view the results by checking the reports. For more information, see Reports
. In this example, you can see the following two reports: One for shutdown and the other for startup.

Task execution report

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:77 次

字数:5096

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文