Click or drag to resize

Remove-DtSourceQueueSnapshot

This cmdlet deletes a coordinated snapshot from the specified jobs. For this cmdlet, the -ServiceHost should be your target server.

Syntax

Remove-DtSourceQueueSnapshot [-CorrelationId] <Guid> [-ServiceHost] <Server> [<CommonParameters>]

Parameters
-CorrelationId<Guid>

Specify the correlation ID of the coordinated snapshots you want to remove.

Required?

true

Position?

3

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServiceHost<Server>

Specify the server object returned from the New-DtServer cmdlet.

Required?

true

Position?

1

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Examples

------------------EXAMPLE------------------

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. An 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. A second array of job IDs is then created, with just one item in the array. The coordinated snapshot for the job in the second array is then deleted. Other snapshots having the same correlation ID but not in the specified array will not be deleted. 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()

$DtJobsArray2 = New-Object "System.Collections.Generic.List[Guid]"

$DtJobsArray.Clear()

$DtJobsArray2.Add($DtJob2.Id)

Remove-DtSourceQueueSnapshot -ServiceHost $DtServerObjectBeta -CorrelationId $CorId -JobIds $DtJobsArray2.ToArray()

Disconnect-DtServer -ServiceHost $DtServerObjectBeta