
Chapter 15: User, Group, and Public Folder Administration
435
Examining the Improved Script
For analysis, this script is broken down into individual segments, each marked with a comment line to
describe what the segment does. The following paragraphs explain how each segment works and are
followed by the specific segment of code they describe.
First, you should notice the comments at the beginning of the script. Think of this section as the script ’ s
documentation. You should always put any information you feel is important for those interested in
using your script. As a good practice you should consider placing revision notes in this section if you
make changes to a script over its lifetime. At minimum your comments should include the script name,
script usage, and an example:
# bulk-newmailbox.v1.ps1
#
# Synopsis: This script creates one or more mailbox enabled user accounts based on
# input values read from a comma separated value (CSV) file. This script
# has to be run by an administrator who is a member of the Exchange
# Recipient Administrators group.
#
# The CSV file must contain these header values on the first line:
#
# Name,Database,OrganizationalUnit,UserPrincipalName,FirstName,LastName
#
# This script writes the results to log file bulk-newmailbox.log in the
# home directory of the current user. New entries are appended to an
# existing log file.
#
# Usage: bulk-newmailbox.v1.ps1 ...