My VM is in powered On state and vmtools running.
I am trying to change the credentials for root user, with which I am authenticating to guest OS.
The code is actually changing the password for root user but returning non zero error code, may be the because the information from guest Os is not returned back becuase now the guest credential is changed.
Is there a way to fix it ?
PS C:\BA> Get-VM template_abhitest | Invoke-VMScript -ScriptType Bash -GuestUser root -GuestPassword test -ScriptText "echo root:Test1234 | chpasswd"
Invoke-VMScript : 12/30/2022 11:35:34 AM Invoke-VMScript Failed to authenticate with the guest operating system using the supplied
credentials.
At line:1 char:41
+ ... _abhitest | Invoke-VMScript -ScriptType Bash -GuestUser root -GuestPa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-VMScript], InvalidGuestLogin
+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_GetProcessOutputInGuest_ViError,VMware.VimAutomation.ViCore.Cmdlets.Comman
ds.InvokeVmScript
But When I try to manually login to console with changed password it works.