Removes a physical rule
Syntax
Remove-DtPhysicalRule [-ServiceHost] <Server> [-WorkloadId] <Guid> [-Rule] <PhysicalRule> [<CommonParameters>]
Detailed Description
This cmdlet removes a physical rule from the specified workload on the specified server.
Parameters
Name | Type | Description | Required | Pipeline Input |
---|---|---|---|---|
Service Host |
Server |
|
true | false |
WorkloadId | Guid |
|
true | false |
Rule | PhysicalRule |
Use the Windows PowerShell New-Object cmdlet to create a physical rule object from DoubleTake.Common.Contract.PhysicalRule. |
true | false |
Outputs
Examples
$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 |
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 $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 |
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.