10-13-2014 06:30 AM
Hello All,
I am trying to copy a file from local server to remote shared location by using the below command -
Copy-Item -Path E:\praghav\latest_log.txt -Destination \\CPO-PRD-04\Shared_Directory\Cognos_Logs_DEV\latest_log.txt
Error - Copy-Item : Access to the path '\\CPO-PRD-04\Shared_Directory\Cognos_Logs_DEV\latest_log.txt' is denied.At C:\Windows\Temp\PO_WorkingDir_d3387d74-c99c-4f00-9008-a4a4adaa9f82\PO_PSScript_d3387d74-c99c-4f00-9008-a4a4adaa9f82.ps1:1 char:10+ Copy-Item <<<< -Path E:\praghav\latest_log.txt -Destination \\CPO-PRD-04\Shared_Directory\Cognos_Logs_DEV\latest_log.txt + CategoryInfo : PermissionDenied: (E:\praghav\latest_log.txt:Fil eInfo) [Copy-Item], UnauthorizedAccessException + FullyQualifiedErrorId : CopyFileInfoItemUnauthorizedAccessError,Microsof t.PowerShell.Commands.CopyItemCommand
Directory already has full access. The command is working fine when i am using it in powershell command prompt.
But it's not working fine in CPO Process.
Any idea?
Thanks,
Prashant
10-14-2014 05:24 AM
Who has full access to it? anyone? Both read/write?
Can you tried standard "copy" from a windows execute function?
10-15-2014 04:16 AM
Yes. Anyone can access it.
I am able to copy the file by using the same command via powershell command prompt but it's not working when i am using CPO activity.
10-15-2014 05:15 AM
Is the PowerShell activity configured to run on the local PO server machine or a remote machine?
10-15-2014 06:14 AM
Did you check the "Select this checkbox if this activity uses remote resources" ? I'm not sure if that will help here, but I normally check it for remote access stuff. (Worth a shot if you have not)
If that does not help, I'd suggest a TAC case.
10-15-2014 07:35 AM
Awesome Shaun!!
It's working for me.
Thankyou so much.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide