Prev | Current Page 627 | Next

Joezer Cookey-Gam, Brendan Keane, Jeffrey Rosen, and Jonathan Runyon

"Professional Windows PowerShell for Exchange Server 2007 Service Pack 1"

The script assumes that all user - related public folders
are to be created under a top level folder named corporate . Therefore the value used to identify the
public folder for which the test is checking is constructed using the text \corporate and the value
stored in the Name property of the user mailbox object stored in $userMB .
The same segment of code that works out the default public folder store for the user later in the script is
also used to determine the name of the server holding the public folder store, which is stored in the
variable $server .
If the Get-PublicFolder command returns a public folder object, then the condition evaluates true and
the statement executes. $hasFolder is set to $true and an error message is displayed to inform the
administrator that a public folder for this user already exists. The value of $hasFolder is returned to the
command that called validateFolder and all processing for the function is complete.
if (get-publicfolder -identity:???\corporate\$($userMB.name)??? -server:$server)
{
$hasFolder = $true
Write-Host -fore yellow ???`nA Public Folder for this user already exists.`n???
return $hasFolder
}
The last command in the function only executes if the if statement evaluates false and returns the value
stored in $hasFolder , which was set to $true at the beginning of the function.


Pages:
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639
botox Kraków Okna PCV Wrocław basketball.sport24x7.net projektowanie ogrodów łódź Wczasy nad morzem