GetUserState
- Last UpdatedOct 29, 2026
- 1 minute read
GetUserState is a built-in function that gets the current state of a specified user โ specifically, whether that user is blocked or unblocked in the project's security system.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
GetUserState |
Security |
Synchronous |
Yes |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
GetUserState(strUserName)
strUserName
The name of the user that you want to get the state of.
Return value
This function returns one of the following possible values:
|
Value |
Description |
|---|---|
|
-8 |
Internal error. |
|
-3 |
The specified user does not exist. |
|
-2 |
Wrong parameter type. |
|
-1 |
Invalid number of parameters. |
|
0 |
The specified user is unblocked. |
|
1 |
The specified user is blocked. |
Notes
This function gets the same information that is shown by the User is blocked option in the account settings for the specified user. For more information, see Blocking or unblocking a user.
Examples
Get the current state of the user named Bob:
GetUserState("Bob")
Get the current state of the user named in position 3 of the array badUsers:
GetUserState(badUsers[3])