Advertising banner:

History
 
 LFS1
Home • Help • Administration • FirstClass Scripting • LFS1
 
Streamlining administration with FirstClass scripting




About FirstClass scripting
FirstClass scripting is a simple scripting language specific to FirstClass. You can use FirstClass scripting to make large changes to your site in a relatively short amount of time. There is a learning curve involved, but the time used to get familiar with scripting will save you hours in routine system administration.
To use FirstClass scripting, you send scripted commands to the FirstClass server. You can combine these commands to reduce the repetition involved in the administration of a large system.
It is important to note that while the server is processsing a script, mail delivery is suspended until the script is finished. You may want to process large scripts during off peak hours.
You can use FirstClass scripting to quickly:
•       add individual users, user groups, and conferences
•       generate lists of users and remote names
•       update user information forms and user group membership.
For example, if you are an education site, you probably need to add large numbers of users every summer to get ready for the next school year. FirstClass scripting enables you to import students' names from an outside source, add them as users to your system, give them the appropriate group memberships and privileges, and set up their Desktops, all in one shot.



Allowing access to FirstClass scripting
By default, only the administrator can send FirstClass scripts. To allow other users to send scripts:
1       Double-click Multi-Site Setup on the administrator's Desktop.
2       Double-click Multi-Site Setup.
3       Select "Allow FirstClass scripting".
If you don't select this field, FirstClass rejects all FirstClass scripting messages unless they are from the administrator.
4       Enter the FirstClass scripting password you want others to use at "Password".
All users (except the administrator) who submit FirstClass scripting messages must enter the password. FirstClass rejects messages lacking a password.
7202010_20004_0.png        Notes
Do not use the admin account password.
Make sure you change the password regularly to prevent unauthorized access.
5       Click OK.
6       Inform all users to whom you want to delegate FirstClass scripting authority of the password you specified.



FirstClass scripting syntax
What you need to know about FirstClass scripting syntax:
•       you must place fields that contain spaces in quotation marks
        Quotation marks are optional for other fields.
•       you can use either single or double quotation marks
        Make sure, though, that your opening and closing quotation marks match.
•       your script must include optional fields that precede those fields you want to use
        This is necessary because fields are recognized by their relative positions.
        You can leave these fields blank by inserting empty quotation marks.
•       you can omit trailing fields, those fields that follow the fields you are using
•       line length maximum is 500 characters
•       all time is stored in seconds.
        An hour has 3,600 seconds.
        A day has 86,400 seconds.



Identifying the correct commands to use
To avoid confusion and ensure you use the correct commands, you need to understand the differences between the following terms:
•       network users/telecom users
The term 'network users' in FirstClass script commands refers to regular users.
        The term 'telecom users' refers to remote users.
        These terms are used for compatability with older scripts.
•       remote users/remote names.
        The term 'remote user' refers to a user who can only connect to a FirstClass system through a remote session.
        The term 'remote name' refers to the Directory entry for a user on another server.



Sending FirstClass scripts to the server
There are two ways to send FirstClass script to the server: issue a command to Batch Admin or process the contents of the server's Batch folder.
Batch Admin command
Use this method for immediate changes that will not affect users currently logged into your FirstClass system.
Send a message containing your command script to Batch Admin. The FirstClass scripting component executes the script on receipt.
Batch folder
Use this method for upgrades and installations.
Place a plain text file with a .ba extension (for example, myscript.ba) and any files referenced by this file in the appropriate folder for your operating system:
•       FCNS/Server/Batch (Windows)
•       Library/FirstClass Server/Volumes/Master/FCNS/Server/Batch (Mac)
•       /var/opt/fcsd/volumes/master/fcns/server/batch (Linux).
To run this file immediately (and process any other contents of the folder), click the Server Control forms's Batch Folder button.
Or you can wait until the next server startup, when the contents of the Batch folder are processed automatically.
The contents of the Batch folder are deleted after they are processed.



Using FirstClass scripting to generate lists
Using FirstClass scripting, you can produce a list (for example, of all users on your system), then import that list into a database or spreadsheet program.
To generate and import a list into another program:
1       Generate the list using a FirstClass script.
Make the script generate a reply message that contains the list. An example of a script that generates a list of regular and remote users is:
reply
list +ux
2       Save the reply message as a text file by choosing File > Save As.
3       Remove the envelope information from this file using a text editor.
4       Import the text file into the database or spreadsheet application.



Using Example.fc to find form and icon IDs
When you install the FirstClass Designer, a settings file called Example.fc is also installed. It is also available from FirstClass Support. This settings file contains all of the standard forms and can be used to look up form IDs and field IDs. You will need those IDs for the GET, NEW, and PUT commands. Example.fc also contains standard user forms, which can be customized.
7202010_20004_0.png        Note
Never alter the template forms such as the User Information, System Profile, Group Privileges, Internet Services configuration, or Directory forms, without consulting OpenText.
Using Example.fc to look up a field ID
To look up a field ID:
1       Start FirstClass Designer and open Example.fc.
2       Open the form.
3       Choose Form > Show Field IDs.
The message fields have special IDs, therefore disregard the field IDs shown in FirstClass Designer. The "To" field is 4, "Cc" field is 5, and "Bcc" field is 14.
Using Example.fc to look up an icon ID
Settings files will automatically contain a list of all of the default icons, even if they are not shown in the icon range. To look up an icon ID:
1       Start FirstClass Designer and open Example.fc.
2       Select the Icon range.
3       Choose Forms > Icon List.



Commands for managing user accounts
add a regular user - ADD NETWORK
add a community regular user - ADD COMMUNITY
add a remote name - ADD REMOTE
add a remote name to your server - AN
add a remote user - ADD TELECOM
add a user to a group - PGADD
change the mail alias of a user - CHGALIAS or PUT USER
change fields on the user information form - PUT USER
change the mail import form - PUT USERCONFIG
delete a remote name - DELALL
delete a remote name registered on your server - DN
delete a user - DEL
delete a user from a group - PGDEL
generate a list of all users, their addresses, and user groups - LIST
diagnose and repair a user's Directory entries - DIAGNOSEDIR/REPAIRDIR
implement secure passwords - ACTIVATE



Commands for managing FirstClass objects, gateways, and routes
add a conference, mail list, or group calendar to a group - PGADD
force the modelling of a group Desktop - APPLY
add a manual route - ADD ROUTE
change the mail alias of a conference, remote name, gateway, or route - CHGALIAS or PUT DIRECTORY
create an object relative to a user's Desktop - NEW DESKTOP
create an object relative to the administrator's Desktop - NEW
delete a conference, mail list, or group calendar from a group - PGDEL
delete a route - DELALL
use form data as a variable - ENABLEFIELDSUBSTITUTION
generate a cross-platform import script that creates objects supported by the NEW command - EXPORT
make a copy of a container COPY
move a container or its content MOVE
generate a specific set of messages - SETEXPORTFILTERS
divert "costly" messages to the bulk message queue - RUNTIME
generate list of leaf and branch items in a container - DIR
process unsent messages or manual rules in a container - PROCESS
put a link to an object on a user's Desktop - LINK USER
put a link to an object on the administrator's Desktop in another container - LINK PATH
put a link to an object on the administrator's or a user's Desktop in another container - LINK SPECIAL
remove an object relative to a user's Desktop - REMOVE DESKTOP
remove an object relative to the administrator's Desktop - REMOVE
rename an object relative to a user's Desktop - RENAME DESKTOP
rename an object relative to the administrator's Desktop - RENAME
upload a file to a conference or folder - UPLOAD
update a settings file - UPDATE



Commands for managing field information on forms
copy the contents of a field from one form to another form, where the field IDs match - COPYFLD
delete field contents from a form - DELFLD
return a field list for a field on a user's Preferences form - GET PREFERENCES
return a field list for a field on a user's profile - GET RESUME
return a field list for a field on the System Profile form - GET SYSPROFILE
return a field list for a field on the user information form  - GET USER
return a field list for a field on the directory info form - GET DIRECTORY
return a field list for a field relative to a user's Desktop - GET DESKTOP
return a field list for a field relative to the administrator's Desktop - GET PATH
return the view properties values of a conference in PUT command format - SNAPSHOT
update a conference's or calendar's Permissions form - PUT PERMISSIONS
update a conference or calendar group - PUT PERMISSIONS MODEL
update a form relative to a user's Desktop - PUT DESKTOP
update a form relative to the administrator's Desktop - PUT PATH
update a user's profile - PUT RESUME
update a user's search form - PUT SEARCH
update any preferences that are stored on the server for a user - PUT PREFERENCES
update forms at the field level - PUT
update the Info form relative to a user's Desktop - PUT PROPERTIES DESKTOP
update the Info form relative to the administrator's Desktop - PUT PROPERTIES
update the System Profile form - PUT SYSPROFILE
update the user information - PUT USER
update the Directory information form of a conference, group, remote name, gateway, or route - PUT DIRECTORY
update the About conference information of a conference or calendar - PUT ABOUT
update the Rules form relative to a user's Destkop - PUT RULES DESKTOP
update the Rules form relative to the administrator's Desktop - PUT RULES



Other commands by function
change the default path separator - PATHCHAR
control indexing - SINDEX
create applications - INITIATEAPPINSTALL, EXECUTE, ENROLL, PUT
populate a global mail list with groups - POPULATE
return a string - WRITE
return main administrator's user ID - GETADMIN
return output as a reply message - REPLY
set a container's subtype SETBASE
specify the batch administration password - PW
stop server processing - EXIT
use license files to upgrade your system - LICENSE
write scripts with logic flow - IF, EXECUTE, ASSIGN, VAR, REPEAT