Applies to: Server!
Version(s): 4.x - 5.x
Warning:    this articles refers to an older version of our software

Many of our users are asking how to add multiple user accounts to Server! at once. Most of them already have a CSV (comma-separated value) text file with username and passwords of the user profiles to be added, so it would make a lot of sense for them to have a simple procedure to import such users from the existing CVS file. You can actually do that very easily by writing a tiny PowerShell script that internally calls our SMSCLI ( Server! Command-Line Interface), and this article shows one way to do so.

The first step is to make sure that we know what VFS these imported users will be using as their “home directory”. For the sake of this example (and to keep it as easy as possible) we will use a parametric VFS like the one shown in the image here below:

You can see the VFS ID by using your browser's debug panel (just press F12 to display the browser's debug panel). Make sure you copy the VFS ID and paste it into the CSV file as shown here below:

Now that the CSV file contains all the necessary (minimal) data, let’s write a PowerShell script to import it:

$csv = Import-Csv -Path C:\Temp\userstoimport.csv
foreach ($line in $csv) {
    & 'C:\Projects\ Server!\_bin\Win64\SMSCLI.exe' -a admin -p someadminpassword -c adduser -username $line.username -userpwd $line.password -allowsftp true -homevfs $line.homevfs

And then simply run the script inside the PowerShell host.

After the script is run, you will see the imported user profiles in your Server! Web Configuration Manager.

That’s it. Plain and easy.