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
I tried both and same access denied error
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
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