Start-up process: access denied (although I provided credentials

I get the following error while trying to execute a line of code

Start-Process : This command cannot be executed due to the error: Access is denied. 

Code is executed

 $username = "domain\username" $passwordPlainText = "password" $password = ConvertTo-SecureString "$passwordPlainText" -asplaintext -force $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $username,$password $powershellArguments = "D:\path\ps.script.ps1", "arg1", "arg2", "arg3", "arg4" Start-Process "powershell.exe" -credential $cred -ArgumentList $powershellArguments -wait 
  • This code works fine when executed locally, but not when called via vbs WMI
  • Both computers exist in the same domain and address range.
  • The user and password have administrator rights on both machines.
  • I tried to work with or without -wait , but none of them work, and because the user has privilege, I would prefer to save it
+8
powershell permissions
source share
1 answer

Q: Have you tried without "-wait"?

Take a look at this link:

The "-wait" option suppresses the command line or saves until the process terminates. This operation may require administrator rights.

+2
source share

All Articles