Post Launch Scripts

Important! The information provided in this section is for general guidance only. The information is provided on "AS IS" basis, with no guarantee of completeness, accuracy or timeliness, and without warranty or representations of any kind, expressed or implied. In no event will CloudEndure and/or its subsidiaries and/or their employees or service providers be liable to you or anyone else for any decision made or action taken in reliance on the information provided above or for any direct, indirect, consequential, special or similar damages (including any kind of loss), even if advised of the possibility of such damages. CloudEndure is not responsible for the update, validation or support of scripts.

Note: Post Launch Scripts do not work when the selected Source is an AWS Region.

CloudEndure can run scripts on a Target machineThe Machine created during Test, Cutover or Recovery. after it's launched. This is done by creating the following folder on the Source machineThe computer, physical or virtual machine that needs to be protected by replication (Disaster Recovery) or migrated (Migration) The CloudEndure Agent is installed on the Source machine. and placing the scripts within that folder:

Linux: /boot/post_launch (any files that are marked as executable)

Windows: c:\Program Files (x86)\CloudEndure\post_launch (any .exe, .cmd or .bat files)

Once you put these scripts in the above folders on the Source machineThe computer, physical or virtual machine that needs to be protected by replication (Disaster Recovery) or migrated (Migration) The CloudEndure Agent is installed on the Source machine., the folder will be replicated to the TargetThe location where the Replication Server will be located and where Target machines will be created (as a result of Test, Cutover or Recovery). and be executed once after the target machineThe Machine created during Test, Cutover or Recovery. boots the first time.

You can use this script to convert a PowerShell command into an EXE file.

Note: Post Launch Scripts are ran under the Local Service context.

Clearing Read-Only Disks

The following script may be utilized to clear Target disksThe disks attached to the Target machines. that come up as "read-only". You can learn more about this issue here.

@ECHO OFF
setlocal enableextensions enabledelayedexpansion
SET "cmd=echo list disk | diskpart"
SET /a index = -1
FOR /F "skip=7 usebackq delims=" %%? in (`"%cmd%"`) do (
IF "%%?" NEQ "DISKPART> " IF !index! NEQ -1 (
ECHO select disk !index!>>offreadonlyfile.txt
ECHO attributes disk clear readonly>>offreadonlyfile.txt
ECHO REM online disk>>offreadonlyfile.txt
DISKPART /S offreadonlyfile.txt
DEL offreadonlyfile.txt
)
SET /a index += 1
)

Note: This script it will only clear the readonly flag, and won't bring the disk online. If you want it to change all disks to online as well, delete the REM from the following line:
ECHO REM online disk>>offreadonlyfile.txt

Uninstalling VMTools from Windows

The following script can be utilized to uninstall VMTools post migration from Windows. CloudEndure does not recommend doing this for Failed Over Disaster RecoveryThe CloudEndure solution that enables the recovery or continuation of vital technology infrastructure and systems in case of a crippling event. servers.

This is a powershell script. It needs to be wrapped by a .CMD file, as powershell scripts are not ran automatically by the post_launch.

$regpath = "HKLM:\Software\Microsoft\Windows\CurrentVersion\uninstall"
Get-childItem $regpath | % {
$keypath = $_.pschildname
$key = Get-Itemproperty $regpath\$keypath
if ($key.DisplayName -match "VMware Tools") {
$VMwareToolsGUID = $keypath
}
MsiExec.exe /x $VMwareToolsGUID /qn /norestart
}


©2020 COPYRIGHT CloudEndure - Terms of Service - Privacy Policy - AWS Vulnerability Reporting Guidelines - Report a Security Issue