Quantcast
Channel: Support Portal
Viewing all articles
Browse latest Browse all 1466

Re : Custom Script says it executed, but doesn't actually

$
0
0
Hi Raj,

I found that the following command works when manually run on the computer

runas /user:%computername%\administrator "powershell.exe -noprofile Set-ExecutionPolicy RemoteSigned -Force"

However, it prompts you for a username and password and there is no way to include the password on the command line.

You can include the password on the command line if you use psexec

C:\psexec.exe -u %computername%\administrator -p AdminPasswordHere -accepteula "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noprofile Set-ExecutionPolicy RemoteSigned -Force

However, I would first have to copy psexec to the target computer.  What is the best way to do that?

Viewing all articles
Browse latest Browse all 1466

Trending Articles