# This function checks the public folder database availability
function validatePFStore
{
$databaseNotUp = $false
The if statement in this function uses the Get-PublicFolder cmdlet to check the status of the public
folder database identified by the value stored in the variable $PFDatabase . Before this function is called,
a segment of code is used to work out the default public folder store for the user based on the mailbox
database where the user ??™ s mailbox is located. From this information the name of the server holding the
public folder store is determined and stored in variable $PFDatabase .
This value is passed to Get-PublicFolderDatabase , and the Status parameter is used to cause the
command to actually contact the server where the database is located to see if it is mounted. The results
of this query are returned in the Mounted property, which is de - referenced at the end of the command. If
the database was valid, and the server reports that it is mounted, then the value stored in the property
Mounted is true. The NOT operator changes the results to false and the if statement is skipped.
However, if the database is not mounted, the condition evaluates as true and the if statement executes.
$databaseNotUp is set to $true and an error message is written to the display to tell the administrator
to check the status of the public folder store.
Pages:
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637