How to use PowerShell to create a new mailbox account

Source: Internet
Author: User

Create a mailbox account for your new colleague, which used to operate in Exchange Management console in Exchange servers, and if you encounter many new users, there is a lot of hand-created duplication, so think of using Exchange Management Shell to be created in bulk.

The prerequisite is that you have Windows Powershell Exchange Modules installed on this server.

Create a new PowerShell script file named Createusr.ps1, and then edit the following PowerShell command in Notepad:

$pwd = read-host "Type account password:"-assecurestring

New-mailbox-userprincipalname Abc@yourdomain.com-alias abc-database Yourdatabase-organizationalunit " Yourdomain.com/users "-name" abc "-firstname" A "-lastname" B "-displayname" abc "-password $PWD-resetpasswordonnextlogo N $true

The first command is to specify the initial password for the account;

Then the next is to use the New-mailbox command to create a new mailbox, the following parameters are used to specify the mailbox address, alias, mailbox database, account number of the Active Directory of the OU, name, name, last name, display name, password, whether the next login to modify the password.

The advantage of this script is that you can reduce repetitive operations in the console by requiring a large number of copy-and-paste, which is best if you can improve the script to create it in batches in a way that imports CSV.

Also hope that you experts enlighten.

Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/Mail/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.