Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Help with powershell copy-item

$
0
0

Have you checked "Run the script under specified account" for the component?

If not, it will run on Agent node with identity of local SYSTEM account. So it has no access to other domain machine.

 

When you check the setting "Run the script under specified account:" on, then the PowerShell session will run on agent machine with identity of assigned credential.

Then you can modify the script to not contain -Credential switch:

 

...

$output=Measure-Command {Copy-Item C:\temp\output.dat -Destination \\$transfer_host\c$\temp} | Select TotalMinutes 

rm $lockfile 

Write-Host "Statistic:" $output.TotalMinutes

Write-Host "Message: Copy duration [min]"

Exit 0;


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>