Here is what I did:
$user='saveTheForest\adminuser'
$pwd='Plant@Tree'
$vm='RAIN4EST002'
$cm='command you want to test'
Invoke-VMScript -ScriptType bat -Vm $vm -ScriptText $cm -GuestUser "$usr" -GuestPassword "$pwd"
and received access denid from the command.
Then I used PSCredential object ( -GuestCredential $cre) instead of plain username and password ( -GuestUser "$usr" -GuestPassword "$pwd"), and all went fine:
$secpwd=ConvertTo-SecureString $pwd -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($user, $secpwd)
Invoke-VMScript -ScriptType bat -Vm $vm -ScriptText $cm -GuestCredential $cred
Let me know it this helps.... This might have to do with how you authenticate on the domain.
István