The following code shows the contents of the script file bulk-newmailbox.v1.ps1 :
# 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.
Chapter 15: User, Group, and Public Folder Administration
433
#
# Usage: bulk-newmailbox.v1.ps1 < full path to CSV file >
#
# Example: bulk-newmailbox.v1.ps1 c:\users.csv
param([string]$CSVUPath)
# Turn off error reporting to the display
$ErrorActionPreference = ???SilentlyContinue???
# This function validates the path to the CSV input file
function ValidatePath
{
$notValidPath = $false
if ($CSVUPath -eq ??????)
{
$notValidPath = $true
Write-Host -fore yellow ???`nYou must enter the full path to a CSV file to
use as input to this script.`n???
return $notValidPath
}
if (!(Test-Path -PathType:leaf $CSVUPath))
{
$notValidPath = $true
Write-Host -fore yellow ???`nThe file path entered is invalid.
Pages:
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592