Documentation

Policy Environment

Policy environment functions and procedures are used to get, set, and unset the values of environment variables on the policy server host during the run of a policy.

getlistsetting

Description

The getlistsetting() function returns the value of a list setting in the current policy server host settings file.

Syntax

getlistsetting (setting-name)

Arguments

setting-nameRequired. The list setting to retrieve.

Return values

A list that contains the value of the specified setting.

Example

submitMasterList = getlistsetting("submitmasters");

getnumericsetting

Description

The getnumericsetting() function returns the value of a numeric setting in the current policy server host settings file.

Syntax

getnumericsetting (setting-name)

Arguments

setting-nameRequired. The numeric setting to retrieve.

Return values

A number that contains the value of the specified setting.

Example

delayTime= getnumericsetting("masterdelay");

getstringsetting

Description

The getstringsetting() function returns the value of a string setting in the current policy server host settings file.

Syntax

getstringsetting (setting-name)

Arguments

setting-nameRequired. The string setting to retrieve.

Return values

A string that contains the value of the specified setting.

Example

policyDirectory = getstringsetting("policydir");

getyesnosetting

Description

The getyesnosetting() function returns the value of a yes/no setting in the current policy server host settings file.

Syntax

getyesnosetting (setting-name)

Arguments

setting-nameRequired. The yes/no setting to retrieve.

Return values

A number containing the value of the specified setting.

  • 0 False. A no value
  • 1 True. A yes value

Example

useRNS=getyesnosetting("registrynameservice");

policygetenv

Description

The policygetenv() function sets the value of a local variable to that of an environment variable on the policy server.

Syntax

result = policygetenv (variable);

Arguments

variableRequired. The environment variable on the policy server host that is used to set the value of the local variable.

Return values

The value of the specified environment variable.

Example

In this example, the local variable termtype is set equal to the TERM variable on the policy server.

termtype = policygetenv("TERM");

policysetenv

Description

The policysetenv procedure is used to locally set an environment variable on the policy server host.

Syntax

policysetenv(variable, value)

Arguments

variableRequired. The environment variable on the policy server host to set.
valueRequired. The value to set the variable to.

Return values

Not applicable

Example

In this example, the policy server host’s PATH variable is set to /bin:/usr/bin:/usr/sbin.

policysetenv("PATH", "/bin:/usr/bin:/usr/sbin");

policyunsetenv

Description

The policyunsetenv procedure is used to locally unset an environment variable on the policy server.

Syntax

policyunsetenv(variable)

Arguments

variableRequired. The environment variable to be unset on the policy server.

Return values

The value of the environment variable.

Example

In this example, the environment variable OLDPATH is removed from the policy server’s environment.

policyunsetenv("OLDPATH");

©2003-2025 BeyondTrust Corporation. All Rights Reserved. Other trademarks identified on this page are owned by their respective owners. BeyondTrust is not a chartered bank or trust company, or depository institution. It is not authorized to accept deposits or trust accounts and is not licensed or regulated by any state or federal banking authority.