|
Powershell Execute process I want to execute a command at remote DMZ server with below line. But
it is not authenticating the password and giving access denied error
even though password is correct & able to access remote share with
same password.
$ProcessClass = get-wmiobject -query "SELECT * FROM Meta_Class WHERE
__Class = 'Win32_Process'" -namespace "root\cimv2" -credential $(Get-
Credential) -computername $computer
$results = $ProcessClass.Create( $commandline )
::::::::::Error :::::::::
Exception retrieving member "Create": "Access is denied. (Exception
from HRESUL
T: 0x80070005 (E_ACCESSDENIED))"
At C:\ExeCmd.ps1:72 char:11
+ $results = <<<< $ProcessClass.Create($commandline)
Any idea how to pass the credential safely? |