question

dmTth-2312 avatar image
0 Votes"
dmTth-2312 asked dmTth-2312 commented

External scripts not running in JEA PowerShell

Hi,

I have a JEA configuration and I would like to run some external script in a JEA remote session.

I defined the VisibleExternalCommands in my psrc file:

 VisibleExternalCommands =  'C:\temp\StartTask.ps1'

The StartTask.ps1 script contains this:

 Start-ScheduledTask -TaskPath "\restart\" -Taskname test_task

But I always get this error message in the JEA session when I run StarTask.ps1 :



Start-ScheduledTask : The term 'Start-ScheduledTask' is not recognized as the name of a cmdlet, function, script file, or operable program.

**

Outside of JEA session the StartTask.ps1 script runs without problem.

What is the issue?




windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered dmTth-2312 commented

Is "Start-ScheduledTask" a visible cmdlet?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, as soon as I defined the Start scheduled task in VisibleCmdlets its worked.

I just thought it was enough that if I specify the allowed external scripts at VisibleExternalCommands and everything what is in those scripts will run in JEA session.

I didn't know that I need to enter each command separately for VisibleCmdlets also.

0 Votes 0 ·