Scripting new Active Directory users

I needed an easy way to create users in Active Directory.

PowerShell to the rescue … although it didn’t work out.

The PowerShell command New-ADUser depends on AD having web services enabled which is a feature that came out with 2008 R2 – needless to say the AD server I was working with didn’t have this. So I fell back to the good old fashioned command line: dsadd user.

I put together an excel with columns like this:

So for this data

The following command is generated:

This is going to save me minutes – literally minutes – every month!