This command, when entered without parameters, will walk you through making an AD user with a mailbox, prompting you for the minimum required parameters.
While this might be enough to get you going, there are loads of extra flags that can be added. See below.
-Name <String> This is, of course, the mailbox name.
-Password <SecureString> The user’s password, stored as a SecureString meaning we cannot show it again later.
-UserPrincipalName <String> The user’s UPN name in AD, in the formatusername@domain.
-Alias <String> An alias, which will simplify finding the user in the GALThe Global Address List or GAL for short is used in the Microsoft Exchange email system. It holds all the information on all mail enabled objects within the organization. These can range from individual users to distributions groups. Microsoft Outlook connects to the GAL when you click the "To" email field when you would like to send an email.When Microsoft Outlook is in cached mode, it uses the Offline Address BookThe Offline Address book is a copy of all the mail enabled contacts, users and objects in the Microsoft Exchange organisation. The OABThe Offline Address book is a copy of all the mail enabled contacts, users and objects in the Microsoft Exchange organisation. The OAB is a copy of the Global Address List and all other additional address lists. The OAB is used when an Outlook client is in cached mode, when the Outlook client is not in cached mode it connects directly to the GAL. The OAB is generated once a day from the GAL so if a new user is created then there is a chance that outlook clients that are in cached mode will not get the update until the GAL and the OAB have synced. You can have more than one OAB, the OAB`s are distributed either via public folderA Public Folder is a folder that is stored within Microsoft Exchange on the Public Folder Database. The purpose of Public Folders is so that organisations can create folders to share email and files alike. Public folders can be mail enabled, so they can receive email without any managment.Once the email is in the folder, you can specify who can, read, edit and even see the public folder. or via Web ( IIS ). You can also specify via Mailbox Store what OAB a member of the mailbox store will receive. To force an update of the OAB run the PowerShell command Update-OfflineAddressBook YourOABnamehere
is a copy of the Global Address List and all other additional address lists. The OABThe Offline Address book is a copy of all the mail enabled contacts, users and objects in the Microsoft Exchange organisation. The OAB is a copy of the Global Address List and all other additional address lists. The OAB is used when an Outlook client is in cached mode, when the Outlook client is not in cached mode it connects directly to the GAL. The OAB is generated once a day from the GAL so if a new user is created then there is a chance that outlook clients that are in cached mode will not get the update until the GAL and the OAB have synced. You can have more than one OAB, the OAB`s are distributed either via public folderA Public Folder is a folder that is stored within Microsoft Exchange on the Public Folder Database. The purpose of Public Folders is so that organisations can create folders to share email and files alike. Public folders can be mail enabled, so they can receive email without any managment.Once the email is in the folder, you can specify who can, read, edit and even see the public folder. or via Web ( IIS ). You can also specify via Mailbox Store what OAB a member of the mailbox store will receive. To force an update of the OAB run the PowerShell command Update-OfflineAddressBook YourOABnamehere
is used when an Outlook client is in cached mode, when the Outlook client is not in cached mode it connects directly to the GAL. The OAB is generated once a day from the GAL so if a new user is created then there is a chance that outlook clients that are in cached mode will not get the update until the GAL and the OAB have synced. You can have more than one OAB, the OAB`s are distributed either via public folderA Public Folder is a folder that is stored within Microsoft Exchange on the Public Folder Database. The purpose of Public Folders is so that organisations can create folders to share email and files alike. Public folders can be mail enabled, so they can receive email without any managment.Once the email is in the folder, you can specify who can, read, edit and even see the public folder. or via Web ( IIS ). You can also specify via Mailbox Store what OAB a member of the mailbox store will receive. To force an update of the OAB run the PowerShell command Update-OfflineAddressBook YourOABnamehere
, ( OAB ) which is a copy of the Global Address List. The OAB is downloaded locally to Microsoft Outlook client. The Global address List is automatically updated once everyday although you can force and update to start immediately. When the update is ran, all new objects that are mail enabled are added to the GAL.
.
-Database <DatabaseIdParameter> The database to store the user’s mailbox.
-DisplayName <String> The user’s show name in AD.
-FirstName <String> The user’s first name.
-LastName <String> The user’s surname.
-PrimarySmtpAddress <SmtpAddress> The primary SMTPSMTP or Simple Mail Transfer ProtocolSMTP or Simple Mail Transfer Protocol is a protocol used to send Email over the internet.SMTP runs on port 25 and it its most basic form uses three command/reply sequences.MAIL, RCPT and Data.So an email client sends an email to another client by connecting to the SMTP server of a company which then sends the email to another companies SMTP server which inturn sends the email to the local client. is a protocol used to send Email over the internet.SMTP runs on port 25 and it its most basic form uses three command/reply sequences.MAIL, RCPT and Data.So an email client sends an email to another client by connecting to the SMTP server of a company which then sends the email to another companies SMTP server which inturn sends the email to the local client. address is their email addressAn email address is an address that is attached to a mailbox on an email system. An email address consists of two parts, the local and the domain. So allen.whiite is the local part and techieshelp.com is the domain part. "Allen.White@Techieshelp.com" The local part can be anything you choose, however the domain part must always be what the email domain is set to. In-between the local and domain pats is an @ sign. A record called an MX record holds information where the email domain is. So if you send an email to allen.white@techieshelp.com the MX record tells the email where the mail domain techieshelp is. Once the email hits the mail server the local part of the email address kicks in. The mail box with the part "allen.white" then receives the email. For more in-depth information visit http://en.wikipedia.org/wiki/Email_address#Overview
, in the form mailbox@fqdn.
-ResetPasswordOnNextLogon <$right | $fake> Sets the flag controlling whether or not the user must change their password at next logon.
-SamAccountName <String> The user’s pre-Windows 2000 name, which is specified simply as a 15 character (or less) string.
Here are two examples of how to use this command.
Create a User an Place in OU in Powershell
This command makes an Active Directory user for John Smith in the CorpUsers OU, with a mailbox on the UserDatastore database, and an initial password that must be changed at next logon. It first prompts you for the password which it will store “-AsSecureString” meaning that it cannot be showed again.
$password = Read-Host "Enter password" -AsSecureString
New-Mailbox -UserPrincipalName jsmith@example.com -Alias john
-Database "UserDatastore" -Name JohnSmith –OrganizationalUnit
CorpUsers -Password $password -FirstName John -LastName Smith
-DisplayName "John Smith" -ResetPasswordOnNextLogon $Right
Create a resource Mailbox in Powershell and Set Password and Alias
This command makes a resource mailbox for a conference room in the CorpResources OU, using the CorpResources database, and requiring the password to be set at next logon. This sets the alias as ChaConf1, and will prompt you for the password once you hit enter.
New-Mailbox -UserPrincipalName CharlotteConferenceRoom1@example.com
-Alias ChaConf1 -Name CharlotteConferenceRoom1 -Database
"CorpResources" -OrganizationalUnit ConferenceRooms -Room
-ResetPasswordOnNextLogon $Right
Create a Mailbox for an Existing User in Powershell
This command makes a mailbox for an existing user without a mailbox.
Enable-Mailbox -Identity:’example.com/CorpUsers/Joe Smith'
-Alias:'JoeSmith' -Database: 'UserDatastore'
If you want to learn more about powershell consider this book.
Related posts:
- Export-Mailbox and Import-Mailbox commands missing
- Delete Mail from Multiple Mailboxes
- Forward Exchange 2007 or 2010 email to external account
- Exchange 2010/2007 Send on Behalf , Send as.
- Send an Email from Command Line / Telnet
1 Comment