With Exchange 2007 we have the option to manage our Exchange Server using the Exchage Managment shell which done using commands (cmdlts).
This script is for creating a single user mailbox and an AD user using the shell.
The script called newuser.ps1
Just copy and save the file as newuser.ps1 and don’t forget to change the server and OU details.
$UPN=Read-Host “upn” -System.String
$Alias=Read-Host “Alias” -asPlainText
$Name=Read-Host “Enter Name” -asPlainText
$Password=Read-Host “Enter Password” -AsSecureString
new-mailbox -userPrincipalName $upn -alias $alias -name $name -database “exchange server name\Mailbox Database name” -OrganizationalUnit ‘yourdomain/your_ou_name’ -Password $Password
The script will ask you to provide a password,Alias,name and UPN (the email address).