Guest OS Operations - Disconnect

Declaration

<AMVMWAREGUEST ACTIVITY="disconnect" SESSION="text" />

See Also

Guest OS Operations - Disconnect, Guest OS Operations - File Exists, Guest OS Operations - Get Environment Variable, Guest OS Operations - Get File Information, Guest OS Operations - Get Guest Variable, Guest OS Operations - Kill Process, Guest OS Operations - List Directory, Guest OS Operations - List Process, Guest OS Operations - Login, Guest OS Operations - Logout, Guest OS Operations - Open URL, Guest OS Operations - Rename File, Guest OS Operations - Run Program, Guest OS Operations - Run Script

Description

Disconnects a VMware guest OS connection and ends a VMware session initially established using the Guest OS Operations - Connect activity.

Practical Usage

Disconnects a currently connected VMware guest operating system connection.

Parameters

Connection Properties

Property

Type

Required

Default

Markup

Description

Session

Text

No

GuestOSSession

SESSION="MySession"

The session name associated to the guest OS connection to disconnect. Disconnecting an existing connection also ends the session associated with that connection.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

This task uses several VMware Guest OS activities. It creates a session using the Connect activity, logs onto the guest VMware using the Login activity, and checks if a specific guest file exists on the host using the File Exists activity. If the guest file exists, it is copied over to the host machine using the Copy activity. The task ends with a Disconnect step. Comments are included in the task to explain each step.

 

<AMVARIABLE NAME="myVar"></AMVARIABLE>

<!-- Create a guest session. -->

<AMVMWAREGUEST ACTIVITY="connect" HOSTTYPE="Workstation" VMPATH="C:\Users\Username\Documents\Virtual Machines\Windows Server 2008 x86\Windows Server 2008 (experimental).vmx" GUESTUSERNAME="Techsupport" GUESTPASSWORD="AM1ag7WmWg7U1xbulaHHhbEOLvMrSDiPrC4aME" CONSOLE="yes" LAUNCHGUI="yes" OPENVMTIMEOUT="90" POWERONTIMEOUT="90" />

<!-- Log onto guest. -->

<AMVMWAREGUEST ACTIVITY="login" LOGINUSERNAME="Techsupport" LOGINPASSWORD="AM1ag7WmWg7U1xbulaHHhbEOLvMrSDiPrC4aME" LOGINCONSOLE="yes" TIMEOUT="3000" />

<!-- Check if a specific guest file exists. -->

<AMVMWAREGUEST ACTIVITY="file_exists" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" RESULTVARIABLE="myVar" />

<!-- If guest file exists, copy it over to the host machine. -->

<AMIF EXPRESSION="%myVar% = True">

     <AMVMWAREGUEST COPYFROM="guest_to_host" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" HOSTFILE="C:\Users\techsupport\Desktop\hello.txt" />

</AMIF>

<!-- Close Connection -->

<AMVMWAREGUEST ACTIVITY="disconnect" />

 

↑ Top of Page