
Part IV: Automating Administration
430
The CSV File
A CSV file is a data file made up of text stored in columns/fields separated by commas, and
rows/records separated by newlines (
CR+LF ). Spreadsheet applications are ideal for creating CSV files.
They allow administrators to populate information in a structured row/column format before saving
the results as a CSV file.
The
Import-Csv cmdlet requires the first row in a CSV file to contain the names for each column of
information. This first row is often referred to as the “ header. ” The names used in the header determine
the property names for the objects created when the CSV file is read by
Import-Csv . Property names are
completely arbitrary but must not contain any spaces. For consistency, you should use names that
correspond to the cmdlet parameter names for which the property values are to be used as input.
The following example shows the first few lines of a CSV file that could be used as input for the
simplebulk-newmailbox.ps1 script. The header row contains the names of each individual property
required as input by
New-Mailbox . Each line that follows the header represents an individual user
account that is to be created based on the given property values. Note that in this example the lines are
wrapped to fit the format of this page.
Name,Database,OrganizationalUnit,UserPrincipalName
User One,MB001\First ...