![]() |
Get-DtSourceQueueSnapshots |
This cmdlet returns all coordinated snapshot for one correlation ID. For this cmdlet, the -ServiceHost should be your target server.
Get-DtSourceQueueSnapshots [-CorrelationId] <Guid> [-ServiceHost] <Server> [<CommonParameters>]
Required? |
false |
Position? |
3 |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Required? |
true |
Position? |
1 |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters. |
Several variables are set including a unique correlation ID for the snapshots that will be taken as well as URI identifiers for the source servers of existing jobs. A server object is created for the server beta using the domain\administrator and password credentials. It assigns the server object to the variable called DtServerObjectBeta. The jobs are retrieved from DtServerObjectBeta, and the job information is inserted into unique variables. And array of job IDs is then created. A coordinated snapshot is taken using the specified correlation ID and the jobs stored in the array. Only those jobs will have coordinated snapshots. Then the coordinated snapshots for the specified correlation ID are returned. The connections for the server object are then closed.
$CorId=New-Guid
$Source1Uri = "dtms://112.42.7.63:6325/"
$Source2Uri = "dtms://112.42.7.71:6325/"
$DtServerObjectBeta = New-DtServer -Name beta -UserName domain\administrator -Password password
$DtJob1 = Get-DtJob -ServiceHost $DtServerObjectBeta | Where-Object { $_.SourceHostUri -eq $Source1Uri}
$DtJob2 = Get-DtJob -ServiceHost $DtServerObjectBeta | Where-Object { $_.SourceHostUri -eq $Source2Uri}
$DtJobsArray = New-Object "System.Collections.Generic.List[Guid]"
$DtJobsArray.Clear()
$DtJobsArray.Add($DtJob1.Id)
$DtJobsArray.Add($DtJob2.Id)
Checkpoint-DtConnectionSourceQueue -ServiceHost $DtServerObjectBeta -CorrelationId $CorId -JobIds $DtJobsArray.ToArray()
Get-DtSourceQueueSnapshots -ServiceHost $DtServerObjectBeta -CorrelationId $CorId
Disconnect-DtServer -ServiceHost $DtServerObjectBeta