The user must enter the full CSV file path value following the script name
when running the script.
# Input Parameter
param([string]$CSVUpath)
The next code segment creates a variable to store a master secure password value to set on each
Active Directory account created by New-Mailbox . A value with data type of System.Security
.SecureString is required by New-Mailbox . The Read-Host cmdlet provides the AsSecureString
parameter to allow the creation of a SecureString object. The execution of this command displays
Enter Password: as a prompt on the command line and then pauses for input.
As the administrator types a password value, each key press results in the display of an asterisk ( * )
character to obfuscate the value. Pressing Enter stores the password value as a SecureString object in
the $password variable. Note that the password entered must meet the password complexity
requirements enforced by the Active Directory group policy applied to the domain where the accounts
are to be created or the script will fail.
# Prompt for the master password to set on the new mailbox enabled accounts
$password = (Read-Host -AsSecureString ???Enter Password???)
This next code segment creates a variable to store objects based on values read from the CSV file
specified in variable $CSVUpath .
Pages:
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581