VMware Cloud Community
dmfranko
Contributor
Contributor

Authentication Issue

Hello,

I'm running into an issue with authentication.  We aren't passing credentials explicitly at any point, but the user that's executing these commands does have permission.  The issue that I'm having it that this is a problem on some servers and not others.  All different version of the client and OSes.  However, if I pass the same credentials that it shows I'm using as an output to Connect-VIServer explicity to Invoke-VMScript using GuestUser and GuestPassword it works fine.

Connect-VIServer yyy-vcenter01
$VM = Get-VM Server
Invoke-VMScript -VM $VM -ScriptText "echo 'hi'"

Invoke-VMScript : 3/20/2020 8:43:38 AM  Invoke-VMScript            Error occured while executing script on guest OS in VM 'Server'. Could not locate

"Powershell" script interpreter in any of the expected locations. Probably you do not have enough permissions to execute command within guest.

At line:1 char:1

+ Invoke-VMScript -VM $VM -ScriptText "echo 'hi'"

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (VM:UniversalVirtualMachineImpl) [Invoke-VMScript], VimException

    + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_RunScriptCore_ExeLookupFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands

0 Kudos
3 Replies
LucD
Leadership
Leadership

Could it that this user does not have a profile on the guest OS in that VM?


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

0 Kudos
dmfranko
Contributor
Contributor

I don't think so.  If I explicitly pass the same credentials that are otherwise being "passed through" it works fine.

0 Kudos
LucD
Leadership
Leadership

So you think it is an SSPI issue.
Can you try adding the -Verbose switch?
What kind of guest OS is running in that VM?


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

0 Kudos