Back to Geneos FAQ

How can I capture the username when running a command?

There is a special client-side xpath in a command that gives the user name.

  1. Create a xpath argument to the command like this: /geneos/client/runtimeParameters/@Username

  2. Use parameters inside your command script, such as “$1”, to capture the parameter in your code

This only works when the command is executed interactively in a Geneos user interface component such as the Active Console. When a command is run as part of a background action then no Username is defined and this situation should be tested for in your external script(s).

["Geneos"] ["Geneos > Gateway"] ["FAQ"]

Was this topic helpful?