Importing Serv-U 7+ Users Via CSV Through the Command Line - KB Article #1716Related Articles -- 1776, 2042
Serv-U allows administrators to import users directly to their server via files in the CSV (Comma-Separated Values) format.
Importing users through the command line only works on Windows.
To import users, "Serv-U-Setup" has to be used, and this file is only installed on
Windows, but not on Linux. This file is located in the installation directory of Serv-U. By default, this is
On Windows systems, run Serv-U-Setup.exe with which you can specify the following command-line arguments:
You can navigate to the directory that contains the Serv-U-Setup.exe file, and then run the following command:
Serv-U-Setup.exe -import:"C:\users.csv" -domain:"example.com" -collection:"ABC"
Alternatively, you can run the command by providing the full path to Serv-U-Setup.exe. For example:
"C:\Program Files\RhinoSoft\Serv-U\Serv-U-Setup.exe" -import:"C:\users.csv" -domain:"example.com" -collection:"ABC"
Note: If the path name contains spaces, make sure that you enclose the full path name in quotation marks.
CSV File Formatting Rules
The CSV file imported must contain four columns and follow the general format displayed below:"LoginID","Password","HomeDir","AdminType","DirAccess"
Adding a group would look like the following example."LoginID","Password","HomeDir","AdminType","DirAccess","GroupName"
The settings are as follows:
- LoginID - The username of the account to be imported
- Password - The password of the account to be imported (if encrypted, follow the directions at KB #1177)
- HomeDir - The home directory of the account to be imported
- AdminType - The administrative privileges of the user, if any. A value of 0 means "No Privileges", a value of 1 means "Domain Administrator", and a value of 2 means "System Administrator"
- DirAccess -
Sets directory access permissions for the user. By default, users are granted Read/Write/Append/Delete access to files and List/Create/Remove access to directories, and Inherit is enabled. To select custom access rules, enter a value here to be calculcated according to the rules defined at KB Article #1776.
The following format is used to allow multiple rules to be imported at the same time. The format is:
- nRules - The number of Directory Access rules that will be declared in the entry
- nParameters - This begins the Directory Access rule. If the rule will be read-only, use the integer 2. If the rule will be anything other than read-only, use the integer 4.
- "Dir" - This is a string literal and must be entered as "Dir" WITHOUT the quotation marks
- sDirectory - This is the directory for which permissions will be granted. %HOME% and %USER% are acceptable variables, and double slashes must be used (C:\\temp instead of C:\temp) for subdirectories
- "Access" - This is a string literal and must be entered as "Access" WITHOUT the quotation marks
- nAccess- This is the calculated integer value of the permissions
- GroupName - Sets the group membership for the user.
- nGroups - The total number of groups that the user is a member of.
- nParameters - The number of parameters to follow (GroupName, TheNameOfTheGroup).
For example, there are three groups (Group A, Group B, and Group C).
"3,2,GroupName,Group A,2,GroupName,Group B,2,GroupName,Group C"