Importing users via CSV files

Importing users via CSV files

Sometimes there is a need to import users though a CSV file. This can be done using a combination of PowerShell and the srxCFG utility.


Lets assume we have a CSV file, users.csv, which looks like this:


Username,FullName,EmailAddress

user1,User Number 1,user1@southrivertech.com

user2,User 2,user2@southrivertech.com

user3,User 3,user3@southrivertech.com


Create a PowerShell script, ImportUsersCsv.ps1 containing the following: (note that your Admin password and Server will be different:



$users = import-csv users.csv

ForEach ($user in $users) {

$username = $($user.Username)

$fullname = $($user.FullName)

$email = $($user.EmailAddress)

.\srxCfg.exe /AdminUser=Administrator /AdminPass=test /Server=SftpServer /Cmd=AddUser /User=$username /FullName=$fullname /EmailAddress=$email

}


This PS script will pull in the users.csv file into an array, $users. Next a loop is performed to pull the Username, Fullname and Email address members from each array item and then feeds those items into the srxCfg.exe utility in the \Program Files\South River Technologies\Titan FTP Server\ folder.


Execute the PS script and the users will be imported in to the system.







    • Related Articles

    • Removing a user via the Registry

      Problem: Corrupted user accounts and how to remove a user via the Registry Answer: Have you restarted the Titan Daemon from the Services Applet panel? If so, and the problem still persists, please do the following: If the configuration for Titan has ...
    • Video: Zipping Files Event

      This tutorial covers the steps to create an automated event which will zip files up when they arrive on the server.
    • Deleting old log files

      The Run File/Script action in the Titan/Cornerstone 2019 Events Management system can be used to delete old log files from the system. the parameters must be File/Script: cmd.exe parameter 1: /c del /F /Q parameter 2: "<the target of the delete ...
    • PGP - Downloading/Renaming decrypted files

      Files that are decrypted and downloaded will have a .pgp file extension. The end-user can rename the file upon download.       
    • PGP - Downloading/Renaming decrypted files

      Files that are decrypted and downloaded will have a .pgp file extension. The end-user can rename the file upon download.