Chapter 1. Context management

Table of Contents

createcontext
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
deletecontext
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
listcontext
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
disablecontext
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
disableallcontexts
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
enablecontext
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
enableallcontexts
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
changecontext
Parameters
Extra parameters when authentication is enabled
Return value
Mandatory parameters
Command output
Example
getAdminId

createcontext

createcontext is the tool to create new contexts. A context is an independent instance within the createcontext Open-Xchange system and holds users, groups and resources and all their objects. Data from one context is not visible to other contexts. Module access (calendar, tasks, email) can be set via predefined "access combination names". These names can be configured on the server side. All users which are created during later use of the "createuser" tool will inherit the module access rights from the context. If you do not specify any access rights on createcontext minimal access rights will be granted. Currently, these are Webmail and Contacts access rights.

Parameters

-h,--helpPrints a help text
--environmentShow info about commandline environment
--nonlRemove all newlines (\n) from output
-c,--contextid <integer>The id of the context, when starting with 0, 0 is deleted
-q,--quota <integer>Context wide filestore quota in MB
-u,--username <string>Username for the new context admin user
-d,--displayname <string>Displayname for the new context admin user
-g,--givenname <string>Given name for the new context admin user
-s,--surname <string>Surname/last name for the new context Admin user
-p,--password <string>Password for the new context Admin user
-e,--email <string>Primary E-Mail address for the new context Admin user
-l,--lang <lang>Language for the new context Admin user
-t,--timezone <timezone>Timezone for the new context Amin user
-N,--contextname <string>Context name
-L,--addmapping <string>Add login mappings separated by ","
--access-combination-name <access-combination-name>Access combination name
--csv-import <CSV file> Full path to CSV file with user data to import. This option makes mandatory options obsolete, except credential options (if needed).

--csv-import <CSV file>

Full path to CSV file with user data to import. This option makes mandatory command line options obsolete, except credential options (if needed). But they have to be set in the CSV file.

With this option you can specify a csv file (a full pathname must be given) with the data which should be imported. The columnnames in the CSV file must be the same as the long-options of the command line tools, without the prefix "--".

This option will normally be used to fill new large installations with the new data. So instead of calling the command line tools in a shell script every time, just a csv file needs to be created, containing the whole data.

Note that the credentials of the masteradmin in the createcontext call must be given on the command line with the -A and -P options nevertheless - if authentication is enabled. If the createuser command line tool is used, the credentials are part of the csv file, and cannot be set as options on the command line itself. The reason for this different behavior is that different contexts have different credentials for the admin user, so they must be set in every line of the csv file. Opposed to this the credentials of the masteradmin are always the same.

Extra parameters when authentication is enabled

-A,--adminuser <string>Master Admin user name
-P,--adminpass <string>Master Admin password

Return value

0 on success

>0 on failure

Mandatory parameters

contextid {adminuser adminpass} quota username displayname givenname surname password email

Command output

On success:

context <contextid> created

On failure:

context <contextid> could not be created: <reason from server>

Example

root@oxhe~# /opt/open-xchange/sbin/createcontext -c 123 -q 1000 -N CompanyA -u "admin" -d "Admin of CompanyA" -g John -s Example -p newpw -e john@example.com

context 123 created