User Administration Commands

You can use the command line to perform the following actions on user administration:

  • Managing Departments, Users, or Roles in a CSV File
  • Deleting User Data for Deleted Users

Details of data that can be managed using a CSV file are as follows:

  • Organization
    • Organization details
    • Organization member data
  • Users
    • User profile
    • Membership information data
    • Role data by user
  • Role
    • Role details
    • User data by role

Importing Departments, Users, and Roles from a CSV File

Use the command line to import departments, users, or roles from a CSV file.

Command
Organization Command
Imports organization details import_organization.csp
Imports organization members import_organization_user.csp
Users Command
Imports user profiles import_user.csp
Imports membership information data import_user_organization.csp
Imports role data by user import_user_role.csp
Role Command
Imports role details import_role.csp
Imports user data by role import_role_user.csp
Parameters
Parameters Required item Description
localfile Specify a path to the CSV file to import.
The CSV file must have permissions to allow the users running the Web server to view the file.
charset   Specify the character encoding of the CSV file to import. Youo can use the following character codes:
  • SJIS-win
  • UTF-8
  • ASCII
  • ISO-8859-1
  • GB2312
  • TIS-620
If omitted, the value in "default_external_encoding" of the config file common.ini is used. The default value is SJIS-win.
skip   Specify one of the following values:
  • 1
    Imports data by skipping the header row of a CSV file.
  • 0
    Imports data including the header row from a CSV file.
When omitted, imports the header row and data from a CSV file.
old   Only applicable for importing user profile CSV files.
Specify one of the following values:
  • 1
    Imports a CSV file generated in Garoon earlier than version 3.1.0 to Garoon 3.1.0 or later.
  • 0
    Imports a CSV file in the format for Garoon version 3.1.0 or later.
If omitted, import a CSV file in the format for Garoon 3.1.0 or later.
Execution Example

Assuming the example setting below, the command usage is as follows:

  • Data type: User profiles
  • Character encoding: UTF-8
  • Header row: Skip

On Windows:

.\grn.exe -C -q code\command\import_user.csp localfile=user.csv charset=UTF-8 skip=1
On Linux:
./grn.cgi -C -q code/command/import_user.csp localfile=user.csv charset=UTF-8 skip=1

Exporting Departments, Users, and Roles from a CSV File

Use the command line to export departments, users, or roles to a CSV file.

Command
Organization Command
Exports organization details export_organization.csp
Exports organization members export_organization_user.csp
Users Command
Exports user profiles export_user.csp
Export organization members export_user_organization.csp
Exports role data by user export_user_role.csp
Role Command
Exports role details export_role.csp
Exports user data by role export_role_user.csp
Parameters
Parameters Required item Description
charset   Specify the character encoding of the CSV file to export. Youo can use the following character codes:
  • SJIS-win
  • UTF-8
  • ASCII
  • ISO-8859-1
  • GB2312
  • TIS-620
If omitted, the value in "default_external_encoding" of the config file common.ini is used. The default value is SJIS-win.
title   Specify one of the following values:
  • 1
    The item name is exported to the first row of the CSV file.
  • 0
    The item name is not exported to the CSV file.
If omitted, the item name will not be exported to the CSV file.
old   Only applicable for importing user profile CSV files.
Specify one of the following values:
  • 1
    Exports user profiles to a CSV file in the format for Garoon earlier than version 3.1.0.
  • 0
    Exports user profiles to a CSV file in the format for Garoon version 3.1.0 or later.
If omitted, the user profiles will be exported to a CSV file in the format for Garoon version 3.1.0 and later.
Execution Example

Assuming the example setting below, the command usage is as follows:

  • Data type: User profiles
  • Character encoding: UTF-8
  • Header row: Exported item name

On Windows:

.\grn.exe -C -q code\command\export_user.csp charset=UTF-8 title=1 > user.csv
On Linux:
./grn.cgi -C -q code/command/export_user.csp charset=UTF-8 title=1 > user.csv

Deleting User Data for Deleted Users

Use the command line to delete user information, permissions, and notifications for users who have been deleted.
You can delete user data by specifying the target user.

Command
delete_user.csp
Parameters
Parameters Required item Description
login_name   The input type of this argument is a string (one line).
Specify the login name of the user to delete data. Only users who have been deleted can be specified.
help   Displays help for this command.
Execution Example

Assuming the example setting below, the command usage is as follows:

  • Login Name: sato

On Windows:

.\grn.exe -C -q code\command\delete_user.csp login_name=sato
On Linux:
./grn.cgi -C -q code/command/delete_user.csp login_name=sato