Click or drag to resize

Remove-DtPhysicalRule

This cmdlet removes a physical rule from the specified workload on the specified server. For this cmdlet, the -ServiceHost should be your source server.

Syntax

Remove-DtPhysicalRule [-Rule] <PhysicalRule> [-WorkloadId] <Guid> [-ServiceHost] <Server> [<CommonParameters>]

Parameters
-Rule<PhysicalRule>

Use the Windows PowerShell New-Object cmdlet to create a physical rule object from DoubleTake.Common.Contract.PhysicalRule.

Required?

true

Position?

3

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WorkloadId<Guid>

Specify the workload GUID returned from the New-DtWorkload cmdlet using the workload type name parameter.

Required?

true

Position?

2

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 1------------------

A server object is created for the server alpha using the domain\administrator and password credentials. It assigns the server object to the variable called DtServerObjectAlpha. The script then creates a workload on the server for a files and folders job, returning a global unique ID for the workload, and assigns that ID to the variable DtWorkloadGuid. A new object is created from Double-Take.Common.Contract.PhysicalRule to store the physical path C:\DirName in the variable DtPhysicalPath. Finally, the physical rule is removed from the workload on the server. The connections for the server object are then closed.

$DtServerObjectAlpha= New-DtServer -Name alpha -UserName domain\administrator -Password password

$DtWorkloadGuid = New-DtWorkload -ServiceHost $DtServerObjectAlpha -WorkloadTypeName FilesAndFolders

$DtPhysicalPath = New-Object DoubleTake.Common.Contract.PhysicalRule -Property @{Path="C:\DirName"}

Remove-DtPhysicalRule -ServiceHost $DtServerObjectAlpha -WorkloadId $DtWorkloadGuid -Rule $DtPhysicalPath

Disconnect-DtServer -ServiceHost $DtServerObjectAlpha

------------------EXAMPLE 2------------------

A server object is created for the server alpha using the domain\administrator and password credentials. It assigns the server object to the variable called DtServerObjectAlpha. The script then creates a workload on the server for a files and folders job, returning a global unique ID for the workload, and assigns that ID to the variable DtWorkloadGuid. The workload information for the workload is then stored in DtWorkloadInfo. The physical rule within DtWorkloadInfo called C:\DirNameToRemove is then stored in DtRemoveRule. Finally, the physical rule DtRemoveRule is removed from the workload on the server. The connections for the server object are then closed.

$DtServerObjectAlpha= New-DtServer -Name alpha -UserName domain\administrator -Password password

$DtWorkloadGuid = New-DtWorkload -ServiceHost $DtServerObjectAlpha -WorkloadTypeName FilesAndFolders

$DtWorkloadInfo=Get-DtWorkload -ServiceHost $DtServerObjectAlpha -WorkloadId $DtWorkloadGuid

$DtRemoveRule = $DtWorkloadInfo.PhysicalRules | Where-Object {$_.Path -eq "C:\DirNameToRemove"}

Remove-DtPhysicalRule -ServiceHost $DtServerObjectAlpha -WorkloadId $DtWorkloadGuid -Rule $DtRemoveRule

Disconnect-DtServer -ServiceHost $DtServerObjectAlpha