![]() |
The following sample script will gather and view job information, including the job ID, the job status, the high and low level options the job is using, and the job statistics. The low-level options gathered and displayed by this script are for a full server job. You will need to modify this script to fit your environment and configuration.
Be sure and expand your screen wide enough so that lines in the script file do not wrap.
# Sample script to gather and view Double-Take job information # This script is based on an existing full server job
# Import the Double-Take PowerShell module # This may be \Service\ or \Console\ depending on your installation import-module "C:\Program Files\Vision Solutions\Double-Take\Console\DoubleTake.PowerShell.dll"
# Login to your source and target servers $DtSource = New-DtServer -Name alpha -UserName domain\administrator -Password password $DtTarget = New-DtServer -Name beta -UserName domain\administrator -Password password
# Gather and display the job ID $DtFSJobId = $(Get-DtJob –ServiceHost $DtTarget).Id write-output " " write-output " " write-output "====================" write-output "This is the job ID for the job running on the following server: "$DtTarget.HostName"" $DtFSJobId
# Gather and display the job status $DtFSJobStatus = $(Get-DtJob -ServiceHost $DtTarget).Status write-output " " write-output " " write-output "====================" write-output "This is the job status." $DtFSJobStatus
# Gather and display the high-level options being used in the job $DtFSJobOptions = $(Get-DtJob -ServiceHost $DtTarget).Options write-output " " write-output " " write-output "====================" write-output "These are the options the job is currently using." $DtFSJobOptions
# Gather and display the low-level options being used in the job # These options are specific to full server jobs $DtFSJobOptionsDetailed = $(Get-DtJob -ServiceHost $DtTarget).Options.FullServerFailoverOptions write-output " " write-output " " write-output "====================" write-output "These are the specific full server options the job is currently using." $DtFSJobOptionsDetailed
# Gather and display the statistics for the job $DtFSJobStatistics = $(Get-DtJob -ServiceHost $DtTarget).Statistics.CoreConnectionDetails write-output " " write-output " " write-output "====================" write-output "These are the statistics for the job." $DtFSJobStatistics
# Close the connections for the server objects Disconnect-DtServer -ServiceHost $DtSource Disconnect-DtServer -ServiceHost $DtTarget |
If you want to hide your user credentials in your script, use the Windows PowerShell Get-Credential cmdlet. The password will not be visible because Windows stores an encrypted password. See Hiding your password in a PowerShell script for basic details on using this cmdlet. See your Windows PowerShell documentation for detailed instructions.