If $users is true , NOT changes the result
of the conditional test to false and the code block is skipped.
if (!$users)
{
Write-Host -fore yellow ???`nFailed to read the input file. It is either invalid
or improperly formatted.`n???
exit
}
The next code segment prompts the user for a secure password and again is very similar to the code
used for the same purpose in the simple version of the script. A better user message has been added to
inform the user about the purpose of the secure password prompt.
# Prompt for the master password to set on the new mailbox enabled accounts
Write-Host -Fore green ???`nPlease enter a temporary secure password for the new user
accounts`n???
$password = (Read-Host -AsSecureString ???Enter Password???)
The next code segment initializes the log file. It starts by storing the current date and time in a variable
called $datetime . This provides a date stamp that is added to the log header information each time the
script is run. The next variable, $logheader , is used to store strings that form the header section of
the log. The strings are stored in the variable formatted in the same way they appear in the script: three
separate lines of text. Where the $datetime and $CSVUpath variables are used in the second line of text,
their values are stored in the variable $logheader in those positions.
Pages:
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601