Creating Users from a .csv File

There may be times when you prefer to use a comma-separated value (.csv) file as your source file. There are several major advantages to taking this route. A .csv file is incredibly easy to create, easy to manipulate, and very easy to work with in Windows PowerShell. When working with a plain text file, you must read the line, and perhaps turn the line into an array if you want to work with multiple elements in the line of text. With a .csv file, you gain the added benefit of having column headers. These make the script utilizing the .csv file as a source file much easier to read. An additional advantage to a .csv file is it requires no additional software installed on the computer. It can be created and maintained ...

Get Windows PowerShell™ Scripting Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.