I am getting access deined when trying to use invoke-method create
This code works if I do not have to pass -cred ( meaning the account running on my local machine has local admin to the remote machine). But, the point of my script is to run all get-wmi code towards machines that may not have pshell installed, and may not have shared accounts,etc. I can get all other wmiobject cmdlets /functions working passing -cred in, but have not been able to get this to work. I was stoked when I saw PSHELL 2.0 had this new cmdlet, but I am pretty frustrated trying to get it to work now ;)
Ex:
invoke-wmimethod -path win32_process -name Create -argumentlist notepad -computername $rc -credential $cred
returns :
format-default : Exception retrieving members: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Again, Other parts of my script that pass this same cred work fine, but they are not invoking a method...
I have tried -Authority and -Impersonation parms to no avail.
Any help?