JEA - Script - Configuration

Hello,

I am currently using JEA to limit access on my servers and to delegate rights.

I don’t understand how the user can run a powershell script without giving him the “powershell.exe”

For example:
I have three scripts.

Test.ps1 (write-host “hello test”)
Test2.ps1(write-host “hello test1”)
Test3.ps1(write-host “hello test2”)

in my role file, I fill in the location of my script:

External commands (scripts and applications) to make visible when applied to a session

VisibleExternalCommands =‘C:\Windows\system32\whoami.exe’,‘C:\Program Files\JEA\Script \Test1.ps1’

But the user cannot launch it.
So if I add:

External commands (scripts and applications) to make visible when applied to a session

VisibleExternalCommands =‘C:\Windows\system32\whoami.exe’,‘C:\Program Files\JEA\Script \Test1.ps1’,‘C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe’

It works but it can run all =(

How do we do that?

Do I need to create a function in a module?

Best regards

Welcome to PowwerShell.org forums.

Is it possible to share the whole JEA configuration ? It might help.

Thank for your reply.

It’s me =(. it works =). It’s just the location of the file.

But, it’s possible to create a script with the cmdlet “Read-host” for interact with a user ?

Hello enter your name :

Your age

Best regards

Its possible, to get a clear picture. Can you explain what you are trying to do with the script.

It’s just a write-host for beginning =)

yea, write-host maybe to see at least see anything getting executed in JEA mode.
But what you are finally trying to achieve is important, JEA is constrained, configuration which is working just for a Write-Host will not work for anything else.

Hum, Probably for add-user in AD ? With the module AD ?

It will be better to have a look at below two links. It should definitely help you.

JEA Session Configurations - PowerShell | Microsoft Docs

JEA Role Capabilities - PowerShell | Microsoft Docs

Thank for your help. Do you have an experience with JEA ?

Nope. I used it long back only to explore it, hence I am not able to provide a reliable response :slight_smile: .

1 Like