Chat now with support
Chat mit Support

Rapid Recovery 6.3 - Command Line and Scripting Reference Guide

Rapid Recovery overview and system requirements Command Line Management Utility PowerShell Module
Prerequisites for using PowerShell Working with commands and cmdlets Rapid Recovery PowerShell module cmdlets
Add-CredentialsVaultAccount AddEncryptionKeytoProtectedMachine Add-EsxAutoProtectObjects Add-EsxVirtualMachines Add-HyperVClusterSharedVirtualDisks Add-HyperVClusterVirtualMachines Add-HyperVVirtualMachines Disable-HyperVAutoProtection Edit-ActiveBlockMapping Edit-AzureVirtualStandby Edit-EsxiVirtualStandby Edit-EsxServerProtectionRules Edit-ExcludedFilesAndFolders Edit-HyperVClusterProtectionRules Edit-HyperVServerProtectionRules Edit-HyperVVirtualStandby Edit-OracleDBVerifyNightlyJob Edit-OracleLogTruncationNightlyJob Edit-Replication Edit-ScheduledArchive Edit-VBVirtualStandby Edit-VMVirtualStandby Enable-HyperVAutoProtection Enable-OracleArchiveLogMode Get-ActiveJobs Get-CloudAccounts Get-Clusters Get-CompletedJobs Get-CredentialsVaultAccounts Get-ExchangeMailStores Get-Failed Get-FailedJobs Get-HyperVClusterSharedVirtualDisks Get-ListAzureVMSizes Get-Mounts Get-OracleInstanceMetadata Get-OracleInstances Get-Passed Get-ProtectedServers Get-ProtectionGroups Get-ProtectionRules Get-QueuedJobs Get-RecoveryPoints Get-ReplicatedServers Get-Repositories Get-ScheduledArchives Get-SqlDatabases Get-TransferQueueEntries Get-UnprotectedVolumes Get-Version Get-VirtualizedServers Get-Volumes Join-CredentialsVaultAccount New-AzureVirtualStandby New-Base New-BootCD New-CloudAccount New-EncryptionKey New-EsxiVirtualStandby New-FileSearch New-HyperVVirtualStandby New-Mount New-Replication New-Repository New-ScheduledArchive New-Snapshot New-VBVirtualStandby New-VMVirtualStandby Open-DvmRepository Push-Replication Push-Rollup Remove-Agent Remove-CredentialsVaultAccount Remove-EncryptionKey Remove-EsxAutoProtectObjects Remove-EsxVirtualMachines Remove-HyperVClusterSharedVirtualDisks Remove-HyperVClusterVirtualMachines Remove-HyperVVirtualMachines Remove-Mount Remove-Mounts Remove-RecoveryPoints Remove-Replication Remove-Repository Remove-ScheduledArchive Remove-VirtualStandby Restart-CoreService Resume-Replication Resume-ScheduledArchive Resume-Scheduler Resume-Snapshot Resume-VirtualStandby Set-AgentMetadataCredentials Set-CredentialsVaultAccount Set-DedupCacheConfiguration Set-License Set-OracleMetadataCredentials Set-ReplicationResponse Start-Archive Start-AttachabilityCheck Start-AzureDeploy Start-AzureExport Start-BackupSettings Start-ChecksumCheck Start-ConfigureAgentMigration Start-ConsumeSeedDrive Start-CopySeedDrive Start-EsxiExport Start-HypervExport Start-LogTruncation Start-MountabilityCheck Start-OptimizationJob Start-OracleDBVerifyJob Start-OracleLogTruncationJob Start-Protect Start-ProtectCluster Start-ProtectEsxServer Start-ProtectHyperVCluster Start-ProtectHyperVServer Start-RepositoryCheck Start-RestoreAgent Start-RestoreArchive Start-RestoreSettings Start-RestoreUrc Start-ScheduledArchive Start-VBExport Start-VirtualStandby Start-VMExport Stop-ActiveJobs Stop-CoreService Suspend-Replication Suspend-ScheduledArchive Suspend-Scheduler Suspend-Snapshot Suspend-VirtualStandby Update-Repository
Localization Qualifiers
Scripting

PostTransferScript.ps1

The PostTransferScript is run on the protected machine after transferring a snapshot.

Sample PostTransferScript

# receiving parameter from transfer job
param([object] $TransferPostscriptParameter)
# building path to Agent's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery Agent 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal)  |  out-null
# Converting input parameter into specific object
$TransferPostscriptParameterObject = $TransferPostscriptParameter -as 
[Replay.Common.Contracts.PowerShellExecution.TransferPostscriptParameter];
# Working with input object. All echo's are logged
if($TransferPostscriptParameterObject -eq $null) {
	echo 'TransferPostscriptParameterObject parameter is null'
}
else {
	echo 'VolumeNames:' $TransferPostscriptParameterObject.VolumeNames
	echo 'ShadowCopyType:' $TransferPostscriptParameterObject.ShadowCopyType
	echo 'ForceBaseImage:' $TransferPostscriptParameterObject.ForceBaseImage
	echo 'IsLogTruncation:' $TransferPostscriptParameterObject.IsLogTruncation
}

PreExportScript.ps1

The PreExportScript is run on the Core before any export job.

Sample PreExportScript

# receiving parameter from export job
param([object]$ExportJobRequest)
# building path to Core's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal)  |  out-null
# Converting input parameter into specific object
$ExportJobRequestObject = $ExportJobRequest -as [Replay.Core.Contracts.Export.ExportJobRequest]
# Working with input object. All echo's are logged
if($ExportJobRequestObject -eq $null) {
		echo 'ExportJobRequestObject parameter is null'
}
else {
		echo 'Location:' $ExportJobRequestObject.Location
		echo 'Priority:' $ExportJobRequestObject.Priority
}

PostExportScript.ps1

The PostExportScript is run on the Core after any export job.

NOTE: There are no input parameters for the PostExportScript when used to run once on the exported protected machine after initial startup. The regular protected machine should contain this script in the PowerShell script folder as PostExportScript.ps1.

Sample PostExportScript

# receiving parameter from export job
param([object]$ExportJobRequest)
# building path to Core's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal)  |  out-null
$regVal2 = $regLM.GetValue('InstallLocation')
$regVal2 = $regVal2 + 'CoreService\Common.Contracts.dll'
# Converting input parameter into specific object
$ExportJobRequestObject = $ExportJobRequest -as [Replay.Core.Contracts.Export.ExportJobRequest]
# Working with input object. All echo's are logged
if($ExportJobRequestObject -eq $null) {
		echo 'ExportJobRequestObject parameter is null'
}
else {
		echo 'VolumeImageIds:' $ExportJobRequestObject.VolumeImageIds
		echo 'RamInMegabytes:' $ExportJobRequestObject.RamInMegabytes
}

PreNightlyJobScript.ps1

The PreNightlyJobScript is run before every nightly job on Core side. It contains the parameter $JobClassName, which helps to handle those child jobs separately.

Sample PreNightlyJobScript

# receiving parameters from Nightlyjob
param([System.String]$JobClassMethod , [object]$NightlyAttachabilityJobRequest, [object]$RollupJobRequest, 
[object]$Agents, [object]$ChecksumCheckJobRequest, [object]$TransferJobRequest, [int]$LatestEpochSeenByCore)
# building path to Core's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal)  |  out-null
<# Nightlyjob has four child jobs: NightlyAttachability Job, Rollup Job, 
Checksum Check Job and Log Truncation Job. All of them are triggering the 
script, and $JobClassMethod (contains job name that calls the script) helps 
to handle those child jobs separately #>
switch ($JobClassMethod) {
# working with NightlyAttachability Job
  NightlyAttachabilityJob {
    $NightlyAttachabilityJobRequestObject = $NightlyAttachabilityJobRequest -as 
    [Replay.Core.Contracts.Sql.NightlyAttachabilityJobRequest];
      echo 'Nightly Attachability job results:';
         if($NightlyAttachabilityJobRequestObject -eq $null) {
           echo 'NightlyAttachabilityJobRequestObject parameter is null';
           }
         else {
            echo 'AgentIds:' $NightlyAttachabilityJobRequestObject.AgentIds;
            echo 'IsNightlyJob:' $NightlyAttachabilityJobRequestObject.IsNightlyJob;
            }
            break;
		}
# working with Rollup Job
  RollupJob {
    $RollupJobRequestObject = $RollupJobRequest -as 
    [Replay.Core.Contracts.Rollup.RollupJobRequest];
      echo 'Rollup job results:';
         if($RollupJobRequestObject -eq $null) {
            echo 'RollupJobRequestObject parameter is null';
            }
         else {
            echo 'SimultaneousJobsCount:' $RollupJobRequestObject.SimultaneousJobsCount;
            echo 'AgentIds:' $RollupJobRequestObject.AgentIds;
            echo 'IsNightlyJob:' $RollupJobRequestObject.IsNightlyJob;
            }
	$AgentsCollection = $Agents -as "System.Collections.Generic.List``1[System.Guid]"
         if($AgentsCollection -eq $null) {
            echo 'AgentsCollection parameter is null';
            }
         else {
            echo 'Agents GUIDs:'
               foreach ($a in $AgentsCollection) {
                  echo $a
            }
         }
         break;
	}
# working with Checksum Check Job
  ChecksumCheckJob {
    $ChecksumCheckJobRequestObject = $ChecksumCheckJobRequest -as 
    [Replay.Core.Contracts.Exchange.ChecksumChecks.ChecksumCheckJobRequest];
      echo 'Exchange checksumcheck job results:';
         if($ChecksumCheckJobRequestObject -eq $null) {
           echo 'ChecksumCheckJobRequestObject parameter is null';
	        }
	     else {
	        echo 'RecoveryPointId:' $ChecksumCheckJobRequestObject.RecoveryPointId;
	        echo 'AgentIds:' $ChecksumCheckJobRequestObject.AgentIds;
	        echo 'IsNightlyJob:' $ChecksumCheckJobRequestObject.IsNightlyJob;
	        }
	        break;
	  }
# working with Log Truncation Job
  TransferJob {
    $TransferJobRequestObject = $TransferJobRequest -as
    [Replay.Core.Contracts.Transfer.TransferJobRequest];
      echo 'Transfer job results:';
         if($TransferJobRequestObject -eq $null) {
            echo 'TransferJobRequestObject parameter is null';
            }
      else {
            echo 'TransferConfiguration:' $TransferJobRequestObject.TransferConfiguration;
            echo 'StorageConfiguration:' $TransferJobRequestObject.StorageConfiguration;
            }
            echo 'LatestEpochSeenByCore:' $LatestEpochSeenByCore;
            break;
		}
}
Verwandte Dokumente

The document was helpful.

Bewertung auswählen

I easily found the information I needed.

Bewertung auswählen