GetProfileValue
You can use the GetProfileValue function to return the profile value for the corresponding key. The function also supports wildcard matching to retrieve multiple profile attributes.
When to use
You can use this function when retrieving profile values programmatically.
Syntax
string[] GetProfileValue(string attribKey);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| attribKey | string | Yes | The name of the profile attribute for which you are retrieving the value. Supports wildcard matching using * to retrieve multiple attributes with similar names. |
Return Value
The application returns the profile value as string[] if the operation is successful.Prerequisites
- The profile attributes must be configured in the system.
- The returned value must match the value defined for the user running the script.
- For example, User 1 has a value of 3 defined for the Security.FailedLoginLimit profile attribute, while User 2 has a value of 5, then:
- If the user 1 runs the script, a value of 3 is returned.
- If the user 2 runs the script, a value of 5 is returned.
Examples
- Example 1
-
string[] retVal = GetProfileValue("AUTOUNLOCKTIME");
- Description
- This example returns the value of the AUTOUNLOCKTIME profile attribute. Use retVal[0] to retrieve the value.
- Example 2
-
string[] retVal = GetProfileValue("IDM*");
- Description
- This example returns the values of profile attributes starting with IDM. You can use a for loop to retrieve the required values.