![]() |
Set-DtJobCredentials |
Updates the credentials for the source, appliance, and VMware host servers used in the specified job.
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>]
Required? |
false |
Position? |
named |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Required? |
false |
Position? |
named |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Required? |
false |
Position? |
named |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Required? |
true |
Position? |
2 |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Required? |
true |
Position? |
named |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
Required? |
true |
Position? |
1 |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters. |
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