ExportSecuritySystem
This function exports the security system configuration to an encrypted file.
Function | Group | Execution | Windows | Embedded | Thin Client | Mobile Access |
---|---|---|---|---|---|---|
ExportSecuritySystem | Security | Synchronous | Supported | Supported | Not supported | Not supported |
Syntax
ExportSecuritySystem( strFileName, strPassword )
- strFileName
- The complete file path and name where you want to save the configuration file.
- strPassword
- The main password for the security system. This same password will be used to protect the exported file.
Returned value
This function returns the following possible values:
Value | Description |
---|---|
-2 | Wrong parameter type. |
-1 | Invalid number of parameters. |
0 | Couldn’t write security data. |
1 | File exported successfully. |
Notes
This function can be called only from scripts executed on the project server. None of the connected clients — not even the client running on the same computer as the project server, because it runs as a separate process on that computer — have the necessary access to the security system. Therefore, generally speaking:
- It can be called from the Startup Script (which is executed when the project itself is run), Script Groups (which are continuously executed by the Background Task), and any Global Procedures called by them; and
- It cannot be called from the Graphics Script (which is executed separately by each client), Screen Scripts (which are attached to individual screens), and Command animations.
For more information, see VBScript Interfaces in the Software.
To work around this limitation, create a Script Group that actually calls the function, configure an appropriate tag/expression trigger in the Execution box of the Script worksheet, and then create a project screen that somehow changes the value of that tag/expression. Therefore, when a user on a connected client uses the screen to change the value, the Script Group will be executed on the project server.
Examples
ExportSecuritySystem( "C:security.txt" )
ExportSecuritySystem( "C:security.txt", "mypa55w0rd" )