Cmdlets > Invoke-DtAddShares

Invoke-DtAddShares

Adds shares to the target

Syntax

Invoke-DtAddShares [-ServiceHost] <Server> [-JobXmlPath] <String> [[-SharePathFilter] <String>] [<CommonParameters>]

 

Detailed Description

This cmdlet takes the drive share configuration that was gathered during Double-Take mirroring and replication and applies it to the target server. This process is independent of the failover process.

Parameters

Name Type Description Required Pipeline Input
Service
Host
Server

Specify the server object returned from the New-DtServer cmdlet. For this cmdlet, the -ServiceHost should be your target server.

true false
JobXml
Path
String

Specify the path and file name to the Double-Take .xml configuration file for the job that contains the protected shares. By default, this location is \Program Files\Vision Solutions\Double-Take\Service\Data. The file name will be JobGuid.xml where Guid is the unique identifier assigned to the job. You can find this ID by using Get-DtJob.

true false
SharePath
Filter
String

Creates shares from the specified path and any subdirectories of this path

false false

Outputs

None

Examples

$DtServerObjectBeta = New-DtServer -Name beta -UserName domain\administrator -Password password

$DtJobInfo = Get-DtJob -ServiceHost $DtServerObjectBeta

$JobId = $DtJobInfo.Id

$PathToJobFile = "C:\Program Files\Vision Solutions\Double-Take\Service\Data\"

$JobFileExtension = ".xml"

$JobFile = $PathToJobFile + "Job" + $JobId + $JobFileExtension

Invoke-DtAddShares –ServiceHost $DtServerObjectBeta –JobXmlPath $JobFile

Disconnect-DtServer –ServiceHost $DtServerObjectBeta

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. All job information for all of the jobs on the server beta are stored in the variable DtJobInfo. This type of usage is common when the jobs were created in the past or if you did not store or do not know a job's ID. In this example, assume there is only one job on the server. See Get-DtJob for examples on how to get specific job information when there are multiple jobs on one server. Job id from the stored job information is stored in the variable JobId. The path to the location of the job file is stored in the variable PathToJobFile. The extension of the job file is stored in the variable JobFileExtension. The variables are appended, together with the word Job, to create the variable JobFile. For example, the JobFile variable might end up being C:\Program Files\Vision Solutions\Double-Take\Service\Data\Job87667a0d-4516-4182-ab8f-13f6fd15dd92.xml. Shares are then added on the server DtServerObjectBeta using the job configuration file stored in JobFile. The connections for the server object are then closed.