I found the error.
I left a line in VisibleCmdlets which contained "Restart-Computer" command but without Force parameter.
So thats why JEA didn't let my script running.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I created a JEA configuration on a Remote Server, everything works except an external script what I specified in the VisibleExternalCommands section in the psrc file:
VisibleExternalCommands = 'C:\temp\Restart_Computer.ps1'
The script would do to restart the Server and it looks like this:
Restart-Computer -ComputerName localhost -Force
However, for some reason it doesn't like the -Force parameter.
Always writes this:
a parameter cannot be found that matches parameter name "Force"
After I tried something. I put this one extra line in my script (and commented the restart part):
Copy-item -Path C:\temp\a.txt -destinaton C:\temp\1 -Force
and it worked.
It copied the txt file without any issue and didn't has problem with the Force parameter.
What could be the problem with the Restart-Computer and Force together?
The script runs without any issue outside of JEA remote session.
I found the error.
I left a line in VisibleCmdlets which contained "Restart-Computer" command but without Force parameter.
So thats why JEA didn't let my script running.
I've never uses JEA, but perhaps the "-Force" isn't allowed for that Cmdlet or user?
He has permission, he uses JEA as virtual Administrator.