Prev | Current Page 620 | Next

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

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

`n???
return $notValidUser
}
(continued)
Part IV: Automating Administration
456
return $notValidUser
}
# This function checks the public folder database availability
function validatePFStore
{
$databaseNotUp = $false
if (!(get-publicfolderdatabase -identity:$PFDatabase -status).mounted)
{
$databaseNotUp = $true
Write-Host -fore yellow ???`nPublic Folder Database
??? $($server.name)\$($PFDatabase.name) ??™ is not available. Please check it ??™ s
status.`n???
return $databaseNotUp
}
return $databaseNotUp
}
#This function validates the need to create a folder for the user specified
function validatefolder
{
$hasFolder = $false
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
}
return $hasFolder
}
# Get the mailbox information for the specified user
$userMB = Get-Mailbox -Identity:$user
# Validate the user is mailbox enabled and the mailbox is a user mailbox
if (validateUser) { exit }
# Figure out where to create the folder
$PFDatabase = (Get-MailboxDatabase -Identity:$userMB.Database).PublicFolderDatabase
$server = (Get-PublicFolderDatabase -Identity:$PFDatabase).server
# Check if the public folder database is available
if (validatePFStore) { exit }
# Validate the user needs a folder created
if (validateFolder) { exit }
(continued)
Chapter 15: User, Group, and Public Folder Administration
457
# Create the folder, exit if folder creation fails for any reason
$newFolder = New-PublicFolder -Name:$usermb.


Pages:
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
Poker Porady noclegi w górach spa nad morzem freeroll titan poker wentylacja