return $hasFolder
The next code segment does the work that must be completed before calling the validateUser
function. This is the point where $userMB is populated with the results of Get-Mailbox using $user as
the identity.
# Get the mailbox information for the specified user
$userMB = Get-Mailbox -Identity:$user
Now that $userMB is set, the validateUser function is called. If the returned results are false, this if
statement is skipped and processing continues. If the results are true, then processing is complete and
the script is exited.
# Validate the user is mailbox enabled and the mailbox is a user mailbox
if (validateUser) { exit }
The next code segment does the work that must be completed before calling the validatePFStore
function. First the Get-MailboxDatabase cmdlet is used to get information for the mailbox database
where the user ??™ s mailbox is located. All mailbox databases have a property called
PublicFolderDatabase that as the name implies, identifies the default public folder database for those
mailbox users. This is where the public folder should be created.
The identity of the mailbox database is determined using the Database property from the user mailbox
object stored in $userMB . The PublicFolderDatabase property is then de - referenced from the results
of Get-MailboxDatabase at the end of the command.
Pages:
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640