Click or drag to resize

Set-DtJobCredentials

Updates the credentials for the source, appliance, and VMware host servers used in the specified job.

Syntax

Set-DtJobCredentials [-JobId] <Guid> [-Source] <PSCredential> [-Target] <PSCredential> [-OtherServers] <Server[]> [-ServiceHost] <Server> [<CommonParameters>]

Set-DtJobCredentials [-JobInfo] <JobInfo> [-Source] <PSCredential> [-Target] <PSCredential> [-OtherServers] <Server[]> [-ServiceHost] <Server> [<CommonParameters>]

Parameters
-Source<PSCredential>

Specify the credential object returned from the Windows PowerShell Get-Credential cmdlet. This password will not be visible because Windows stores an encrypted password.

Required?

false

Position?

named

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Target<PSCredential>

Specify the credential object returned from the Windows PowerShell Get-Credential cmdlet. This password will not be visible because Windows stores an encrypted password.

Required?

false

Position?

named

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OtherServers<Server[]>

Specify the server object returned from the New-DtServer or New-DtUvraServer cmdlet. Specify the server object in an array using the format @($server).

Required?

false

Position?

named

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobId<Guid>

Specify the job GUID returned from the New-DtJob cmdlet or the Id within the job information returned from the Get-DtJob cmdlet.

Required?

true

Position?

2

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobInfo<JobInfo>

Specify the job information returned from the Get-DtJob cmdlet. The job information can be piped from the Get-DtJob cmdlet.

Required?

true

Position?

named

Accept Pipeline Input?

true (ByValue)

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

You will be prompted for credentials for the domain\administrator account and they will be stored in DtCredentials. Then a server object is created for the servers alpha and beta using the stored credentials. The objects are stored in DtServerObjectAlpha and DtServerObjectBeta, respectively. The job(s) are retrieved from DtServerObjectBeta, but only the job information where the source machine name is equivalent to the name stored in the variable DtServerObjectAlpha is retrieved. That information is then stored in the variable DtJobForAlpha. Finally, the credentials are updated for the job using the stored credentials. The connections for the server object are then closed.

$DtCredentials = Get-Credential domain\administrator

$DtServerObjectAlpha = New-DtServer -Name alpha -Credential $DtCredentials

$DtServerObjectBeta = New-DtServer -Name beta -Credential $DtCredentials

$DtJobForAlpha = Get-DtJob -ServiceHost $DtServerObjectBeta | Where-Object {$_.Statistics.CoreConnectionDetails.SourceMachineName -eq $DtServerObjectAlpha}

Set-DtJobCredentials -ServiceHost $DtServerObjectBeta -JobId $DtJobForAlpha.Id -Source $DtCredentials -Target $DtCredentials

Disconnect-DtServer -ServiceHost $DtServerObjectAlpha

Disconnect-DtServer -ServiceHost $DtServerObjectBeta