DSADD users via CSV on Server 2008

Solution 1:

You could use PowerShell. It makes this a little less painless and the script is more straight-forward. I don't remember if it's included by default in Server 2008 or not. If not, it's a feature you can install with Server Manager.

It will import the csv for you automatically. All you need to do is to be sure that the CSV has column headers. See the code below for a quick example. You can expand on dsadd command below to match what you need.

$inputFile = Import-CSV  <insert filepath here>

foreach($line in $inputFile)
{
    dsadd user -samid $line.Username -pwd $line.Password
}