# Created By Alberto Igbinedion
#
# Create Existing AD User specifying Email Address
# To Remove mailbox and without deleting user from AD Run...
# Disable-mailbox UserName

#$Firstname = Read-Host "Enter Firstname"
#$Lastname = Read-Host "Enter Lastname"

$SamAccountName = Read-Host "Enter UserName"
$Email =  Read-Host "Enter EmailAddress" 
$Alias = Read-Host "Enter Alias"

Get-User $SamAccountName |

% {

     Enable-Mailbox -Identity $samaccountname -Alias  $Alias -PrimarySmtpAddress $Email -database "Mailbox Database 1539870071"

     Set-Mailbox -Identity $SamAccountName -EmailAddressPolicyEnabled $True

}

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