Skip to content
Mark Domansky edited this page Apr 11, 2026 · 5 revisions

Tips

This is general tips on how to do things that WebJEA doesn't currently support.

Adding a password field.

Sometimes you want to add a password field. You only have to add a small bit to startup.js

startup.js

Replace FieldName with the name of the variable in both places. If you use something generic like $Password, just replace FieldName with Password and you can use it in multiple scripts easily. If you want to support multiple fields, just repeate the middle line multiple times with each field name you want to replace.

$(function() {
   $('#psparam_FieldName').clone().attr('type','password').insertAfter('#psparam_FieldName').prev().remove();
});

Accessing username and IP of the caller

WebJEA sets $env:WebJEAUserName and $env:WebJEAHostName within the runspace before executing the script. You can access these from within your script.

The format of the username and hostname are controlled by IIS. Most commonly, these are the netbios username and client's IP address, however IIS defines this as a hostname.

Deprecated: You can also define special parameters $WebJEAUserName and $WebJEAHostName within the script. If these are specified, they won't be shown in the UI, but will have data passed to them when the script runs. This feature is deprecated and will eventually be removed. Migrate to using the environment variables.

Clone this wiki locally