Users Guide
VolumeSnapshotInfoDictionary (namespace
Replay.Common.Contracts.Transfer)
Übernimmt die jeweiligen Werte vom Parameter System.Collections.ObjectModel.Collection<VolumeName, VolumeSnapshotInfo>.
Beispiele für PowerShell-Skripts
Die folgenden Beispielskripts werden zur Verfügung gestellt, um die Administratoren bei der Ausführung von PowerShell-Skripts zu
unterstützen.
PreTransferScript.ps1
Das Skript PreTransferScript wird auf der geschützten Maschine vor der Übertragung eines Snapshots ausgeführt.
Beispiel: PreTransferScript
# receiving parameter from transfer job
param([object]$TransferPrescriptParameter)
# 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
$TransferPrescriptParameterObject = $TransferPrescriptParameter -as
[Replay.Common.Contracts.PowerShellExecution.TransferPrescriptParameter];
# Working with input object. All echo's are logged
if($TransferPrescriptParameterObject -eq $null) {
echo 'TransferPrescriptParameterObject parameter is null'
}
else {
echo 'TransferConfiguration:'$TransferPrescriptParameterObject.TransferConfiguration
echo 'StorageConfiguration:' $TransferPrescriptParameterObject.StorageConfiguration
}
PostTransferScript.ps1
Das Skript PostTransferScript wird auf der geschützten Maschine nach der Übertragung eines Snapshots ausgeführt.
Beispiel: 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'
}
472
Erweitern des Rapid Recovery-Jobs über Scripting










