Присвойте сценарий PowerShell для выполнения при использовании запуска PowerShell на Сервере Окна 2012

Вы на правильном пути. Вы определенно хотите использовать DEBIAN_FRONTEND=noninteractive. Для критических вопросов, которые не могут быть проигнорированы, Вы захотите предварительно отобрать debconf база данных с необходимыми ответами. debconf страница справочника имеет все подробности о том, как выполнить это.

6
задан 5 December 2012 в 19:13
1 ответ

It is definitely possible. The basic building blocks you will need are:

  • Amazon's 'User Data' feature, which enables running a user defined script when the instance first launches. There are more details here: https://forums.aws.amazon.com/message.jspa?messageID=342503 .
  • Windows Task Scheduler to schedule a task to execute after Windows restarts. Look at the schtasks.exe command for more details on how to do this (Just type schtasks.exe at the command prompt).

You will need two scripts:

  1. Runs via the 'User Data' feature. Responsible for scheduling the execution of the second script using the windows task scheduler on Windows start up, changing the Windows machine name and restarting Windows. The scheduling command should look something like:

    schtasks.exe /create /TN my-task /SC ONSTART /TR SCRIPT_FILE /RU USERNAME /RP PASSWORD

  2. Runs your applications.

The second script may also delete the scheduled task - depends if you want this VM to recover automatically from restarts or not.

2
ответ дан 3 December 2019 в 00:41

Теги

Похожие вопросы