1

I get an "access denied" error when I want to start a process on a remote computer, even though I'm connecting to the RemoteComputer as a domain admin (which is proven by the output of whoami in the code which gives me the correct domain\admin)

$cred = New-Object System.Management.Automation.PSCredential -argumentlist $Admin, $PW
foreach ($c in $ComputerName) {
    Invoke-Command -ComputerName $c -Credential $cred -ArgumentList $cred,$exepath,$exeargs {
        param($cred,$exepath,$exeargs)
            whoami
        if (!$exeargs) { Start-Process powershell.exe -Credential $cred  }
        else { Start-Process powershell.exe -Credential $cred <#other stuff #> }
    }
}

I saw many question on Stack Overflow regarding this question, but there never really is an answer which helps with this error, only workarounds. (Questions like Powershell Start-Process : This command cannot be executed due to the error: Access is denied and Access-Denied error upon using start-process)

Why do i get an access denied, when trying to start powershell.exe as a domain admin on a remote computer?

Community
  • 1
  • 1
SimonS
  • 1,891
  • 1
  • 29
  • 53

0 Answers0