# Created By Alberto Igbinedion
#
# Create Shared Mailbox
# To Remove mailbox and without deleting user from AD Run...
# Disable-mailbox UserName

$SamAccountName = Read-Host "Enter UserName"
$Email =  Read-Host "Enter EmailAddress"
$Name = Read-Host "Enter Shared Mailbox Name"
$Alias = $Email.Split("@")[0]


% {

New-Mailbox -Name $Name -Alias $Alias –Shared -database "Mailbox Database 1539870071" |


Set-Mailbox -PrimarySmtpAddress $Email -EmailAddressPolicyEnabled $True

}

 Write-Host "$SamAccountName's Shared MailBox Created" -ForegroundColor Green