Hi,
We have a Vcenter(6.5) which includes afew Esxi 6.0 servers(all the servers configured same with 6.0 version, but the server locations are different), we need to send some commands to VM(windows or linux) through powercli and Invoke-VMScript cmdlet,
actually it is working fine but just on some of these esxi servers and their VMs, but for other esxi servers' VMs the Invoke function is freezing(20-30sec) and then returns following error when we send a command:
Invoke-VMScript -ScriptText "pwd" -VM $VMName -GuestCredential $DCLocalCredential
Invoke-VMScript : 7/9/2019 11:10:25 PM Invoke-VMScript An error occurred while sending the request.
At line:1 char:1
+ Invoke-VMScript -ScriptText $check -VM $VMName -GuestCredential $DCL ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-VMScript], ViError
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_DownloadFileFromGuest_DownloadError,VMware.VimAutomation.ViC
ore.Cmdlets.Commands.InvokeVmScript
any solution?
Could it be that you are experiencing the same issue as in Re: Error running Invoke-Vmscript - An error occurred while sending the request. FullyQualifiedError...
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you for your swift response LucD, however I saw this post already, but I didn't figure out where should we add this code to our script exactly or how to use it!
Can you help me with some clue?
Does this issue related to vcenter SSL?(we are using valid SSL certificate)
The code mentioned in that reply, is added to the script where you do the Invoke-VMScript (before the Invoke-VMScript line).
The problem, even with a valid certificate, might be that although the FQDN is mentioned in the certificate, the IP address might not be.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Shall we make any changes on our installed certificates?
does this code damege our current SSL certificates?
No, it will not touch your certificates.
It will just ignore the certificate errors.
When this shows that is indeed an issue with the IP not being in the certificate, you can eventually update the certificates.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank You LucD, we had a IP restriction in Esxi firewall.