VMware Cloud Community
RobM18
Contributor
Contributor
Jump to solution

Copy-vmguestfile. An Error occured when sending the request

Copy-VMGuestFile -Source c:\IT\test.txt -Destination c:\temp\ -VM -VMname- -LocalToGuest -GuestCredential $Cred

Copy-VMGuestFile : 22/02/2023 15:11:58 Copy-VMGuestFile An error occurred while sending the request.
At line:1 char:1
+ Copy-VMGuestFile -Source c:\IT\test.txt -Destination c:\temp\ -VM ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-VMGuestFile], ViError
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_UploadFileToGuest_UploadError,VMware.VimAutomation.ViCore.Cm
dlets.Commands.CopyVMGuestFile

I have checked previous posts and my ports are open on 443.
Ultimately trying to transfer files in our DMZ but it doesn't work when testing to Internal servers as well

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You must also open port 902 between your station and the ESXi node where the VM is running.
From the Copy-VMGuestFile help page.

You must have access to the ESX that hosts the virtual machine over TCP port 902.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

You must also open port 902 between your station and the ESXi node where the VM is running.
From the Copy-VMGuestFile help page.

You must have access to the ESX that hosts the virtual machine over TCP port 902.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
RobM18
Contributor
Contributor
Jump to solution

Brilliant. That's worked straight away.

Thanks for the quick reply.

0 Kudos
zjy2941897721
Contributor
Contributor
Jump to solution

The reason for the error is the same, but both 443 and 902 ports are open. Is there any possible reason

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Does adding the Verbose switch give any more information?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos