BlockUser is a built-in scripting function that blocks an existing user from logging onto a project. This allows you to disable a user account without deleting it.

Function Group Execution Windows Embedded Thin Client Mobile Access
BlockUser Security Synchronous Supported Supported Supported Not supported


Web Studio Help function security blockuser.xml d188729e78 BlockUser
The name of the user to block.

Returned value

This function returns the following possible values:
Value Description
0 User blocked successfully.
1 Invalid number of parameters.
2 Wrong parameter type.
3 Specified user does not exist.
4 User currently logged on does not have the rights to block (i.e., user does not have Edit Security System).
5 The operation on the distributed security system failed.
6 User cannot be blocked.
7 The current Security Mode does not allow user to be blocked/unblocked.
8 Internal error.


If you use this function to block a user, then the option User is blocked is selected in the User Account dialog. For more information, see Creating and configuring users.


Block the user named Bob:
  BlockUser( "Bob" )  
Block the user named in position 3 of the array badUsers:
  BlockUser( badUsers[3] )  
Block the user that is currently logged on:
  BlockUser( UserName )