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 |
|
true | false |
JobId | Guid |
|
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 |
|
false | false |
JobInfo | JobInfo |
|
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.