Adding users to AD via a CSV file
As mentioned several times in this book, https://www.spiceworks.com/ has a busy PowerShell support forum (accessible at https://community.spiceworks.com/programming/powershell). A frequently asked (and answered) question is: How do I add multiple users using an input file? This recipe does just that.
Start with a CSV file containing details of the users you are going to add. This recipe uses a CSV file and adds the users into the AD.
Getting ready
This recipe assumes you have a domain setup and that you have created the IT OU. You did this in earlier recipes in this chapter. This recipe also requires a CSV file of users to add. You can create a CSV file like so:
$CSVDATA = @' Firstname, Initials, LastName, UserPrincipalName, Alias, Description, Password S,K,Masterly, skm, Sylvester, Data Team, Christmas42 C,B Smith, CBS, Claire, Claire, Receptionist, Christmas42 Billy-Bob, Joe-Bob, Bob, BBJB, BBJB, One of the Bob's, Christmas42 Malcolm, DoWrite, Duelittle...