If the user is not mailbox - enabled, $notValidUser is set to $true and an error message is displayed to
inform the administrator the account is not valid. The value of $notValidUser is returned to the
command that called validateUser and all processing for the function is complete.
if (!($userMB))
{
$notValidUser = $true
Write-Host -fore yellow ???`nThe account specified is not mailbox enabled or
could not be found in Active Directory.`n???
return $notValidUser
}
The last if statement in this function tests to see if the mailbox - enabled user object held in $userMB
represents a user mailbox or something else. Exchange Server 2007 provides for other types of mailboxes
such as shared, equipment, and room. The script assumes that administrators only want to create public
folders for user mailboxes using the script. The RecipientTypeDetails property holds the value that
determines the mailbox type.
This if statement tests the value of RecipientTypeDetails to see if it is not equal to ???UserMailbox??? .
If it is, the user is mailbox - enabled and is good to go for public folder creation, so the if statement is
skipped. If it is not, the condition is then true and the statement is processed. $notValidUser is set to
$true and an error message is displayed to inform the administrator the account is not a user mailbox -
enabled account.
Pages:
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635