--- title: How to Set Up Script Actions description: How to Set Up Script Actions author: dansimp ms.assetid: 367e28f1-d8c2-4845-a01b-2fff9128ccfd ms.reviewer: manager: dansimp ms.author: dansimp ms.pagetype: mdop, virtualization ms.mktglfcycl: deploy ms.sitesec: library ms.prod: w7 ms.date: 06/16/2016 --- # How to Set Up Script Actions The script actions editor allows the administrator to create actions to be performed during MED-V workspace setup, as well as to define the order in which they are performed. The following is a list of actions that can be added to the domain setup script: - **Restart Windows**—Restart Windows. - **Join Domain**—If joining a domain, include this action and configure the user name, password, fully qualified domain name, NetBIOS domain name, and organization unit (optional). - **Check Connectivity**—Configure a server to connect to and verify that the MED-V workspace can connect to a network resource (such as the domain server). - **Command Line**—Configure a script in the MED-V workspace, and enter a command line that includes the path of the script and the script arguments. - **Rename Computer**—Rename the virtual machine computer based on the defined settings. - **Disable Auto-Logon**—Disable Windows Auto-Logon. This action should be added at the end of scripts that add the computer to the domain. ## How to Set Up Script Actions **To set up script actions** 1. On the **VM Setup** tab, click **Script Editor**. 2. In the **Script Actions** dialog box, click **Add**, and on the submenu, click the desired actions. 3. Configure the actions as described in the following tables. **Note** **Rename Computer** is configured in the **VM Settings** tab. For more information, see [How to Configure VM Computer Name Pattern Properties](how-to-configure-vm-computer-name-pattern-propertiesmedvv2.md). ~~~ **Note** To rename a computer, Windows must be restarted. It is recommended to add a Restart Windows action following a Rename Computer action. ~~~ 4. Set the order of the actions by selecting an action and clicking **Up** or **Down**. 5. Click **OK**. **Note** When running the Join Domain script, for the script to work, the user logged into the MED-V workspace virtual machine must have local administrator rights. **Note** When running the Disable Auto-Logon script, it is recommended to disable the local guest account used for the auto-logon once the initial setup is complete. ### **Join Domain Properties**
Property | Description |
---|---|
Credentials to use when joining the VM to the domain |
Select one of the following credentials to use when joining the VM to the domain:
Note
The credentials you enter are visible to all MED-V workspace users. It is not recommended to provide domain administrator credentials. |
Domain to join |
Select one of the following:
|
Organization Unit |
An organization unit (OU) may be specified to join the computer to a specific OU. The format must follow an OU distinguished name: OU=<Organization Unit>,<Domain Controller> (for example, OU=QATest, DC=il, DC=MED-V, DC=com).
Warning
Only a single level OU is supported as is shown in the example above. |
Property | Description |
---|---|
IP Address |
The IP Address of the server that you are verifying connection to. |
Port |
The port of the server that you are verifying connection to. |
Timeout |
The number of seconds to wait for a response before timing out. |
Property | Description |
---|---|
Path |
The path of the command line. |
Arguments |
Command-line arguments. |
Wait for exit |
Select the check box to wait for a return before continuing with the script actions. |
Fail on error |
Select this check box if the return is anything but the value specified. Enter the value that will indicate the command as a success. Default: 0 |
Perform only once |
Select this check box to run the command line only once. If the script fails or is canceled, this command will not be performed again. |
This command line causes a restart of Windows in the Workspace |
Select this check box if the command line causes a restart after completion. |
Allow interaction |
Select this check box if the command will require user interaction. |
Progress message |
Message to be displayed to the user while the command is running. |
Failure message |
Message to be displayed to the user if the command fails. |
Parameter | Value | Description |
---|---|---|
%MEDVUser% |
An authenticated user name. |
MED-V authenticated user name. The user name and password can be used in the join domain VM setup script. |
%MEDVPassword% |
An authenticated password. |
MED-V authenticated password. The user name and password can be used in the join domain VM setup script. |
%MEDVDomain% |
Configured domain. |
The domain configured in the MED-V authentication. It can be used on the VM setup script. |
%DesiredMachineName% |
Computer name. |
The unique computer name configured in the management application. It can be used in the VM setup script. |