VMware Cloud Community
tdubb123
Expert
Expert

invoke-vmscript guestcredential

how do I use the guest credential in invoke-vmscript?

I have no problem using local admin password for guestuser and guiestpassword

but when I use a domainuser which is part of the local admin group. it fails with access denied

0 Kudos
22 Replies
tdubb123
Expert
Expert

I tried both and same access denied error

0 Kudos
tdubb123
Expert
Expert

weird, tried

Invoke-VMScript -VM $VM -ScriptText "ECHO RESCAN > C:\windows\temp\DiskPart.txt" -ScriptType BAT -GuestCredential $cred

and got

ScriptOutput

-----------------------------------------------------------------------------------------------------------------------|

-----------------------------------------------------------------------------------------------------------------------

looks to be a windows permission problem but I am local admin

problem is writing to c:\

I could write to c:\windows\temp

0 Kudos
LucD
Leadership
Leadership

Could it be that you have "User Account Control: Admin Approval Mode for the built-in Administrator Account" enabled on that station?

Check via secpol.msc, Local Policies, Security Options.

This is unrelated to UAC being active or not.

Is there a difference when you run with the actual Administrator account of the guest, and with a domain account that is in the Local Administrators group?


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

0 Kudos