Cmdlets > Set-DtJobCredentials

Set-DtJobCredentials

Updates credentials

Syntax

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

 

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

 

Detailed Description

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

Parameters

Name Type Description Required Pipeline Input
Service
Host
Server

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

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

true false
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. See Hiding your password in a PowerShell script for basic details on using this cmdlet. See your Windows PowerShell documentation for detailed instructions.

false 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. See Hiding your password in a PowerShell script for basic details on using this cmdlet. See your Windows PowerShell documentation for detailed instructions.

fasle false
Other
Servers
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).

false false
JobInfo JobInfo

Specify the job information returned from the Get-DtJob cmdlet. The job information can be piped from the Get-DtJob cmdlet and used in this cmdlet.

true true

Outputs

None

Examples

$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

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.