VMware Cloud Community
orian
Hot Shot
Hot Shot

copy file with powershell in orchestrator

Hi,

I wrote a powershell script which creates at the end a csv file and it copies the file to another server.

If I run the script manually in the server it create and copy the file successfully.

When I try to run it from vro with "Invoke an external script" workflow it creates the file but fails when it tries to copy the file to another server with an "Access is denied" error.

I also try to change the permission in the destination to Full Control in share and security permissions.

When I configured the powershell host in vro I used the same user as I run the script manually.

In order to copy the file I use the following line:

Copy-Item "c:\temp\test.csv" "\\servername\testfolder\test.csv"

Thanks!

Reply
0 Kudos
2 Replies
orian
Hot Shot
Hot Shot

any idea?

Reply
0 Kudos
bdamian
Expert
Expert

Have you tried to execute the PS command with credentials?

Ex:

Copy-Item "c:\temp\test.csv" "\\servername\testfolder\test.csv" -Credential $myCredentials

D.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
Reply
0 Kudos