Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Administering an Exchange Server 2013 Environment (part 5) - Performing Common Tasks - Creating Multiple Mailboxes in the Exchange Management Shell

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
2/18/2014 3:11:10 AM
Creating Multiple Mailboxes in the Exchange Management Shell

Given the complexity of creating a new mailbox in the EMS, why would anyone want to do so? Generally, they wouldn’t. But what if your Human Resources Department handed you a list of 50 new employees and requested that you create new mailboxes for all of them? Doing so through the GUI interface of the EAC would not only take hours, but would also result in the increased likelihood that misspellings or mistakes might occur.

That’s where the power of the EMS comes into play.

By putting the list of names in a .csv file, you can quickly create multiple accounts from only two lines of code. To do so, perform the following steps:

1. Create a text file called newusers.csv in a directory called (for our example) c:\scripts.

2. For this example, create several column names and populate the data, as shown in Figure 4. The columns to populate are Name, Alias, UPN, First, and Last. Additional column names can be added, if desired, to populate more data in the user accounts.

Image

Figure 4. Creating the CSV file for multiple mailbox creation.

3. When the .csv file is complete, you are ready to begin. Each user account will be created with a default password, with the user required to reset the password when he or she first logs in. From the Exchange Management Shell, type the following command. (Type it word for word, do not attempt to enter the password yet.)

$Password = Read-Host "Enter Password" -AsSecureString

Press Enter. You will be presented with a prompt stating Enter Password. Type the password you want to apply to all your newly created users and press Enter. Your password will now be assigned to the variable $Password for use in your script.

4. Next, you run two cmdlets, piping the results of the first into the second, to create the new mailboxes from the .csv file. The syntax will be as follows:

Import-Csv "c:\scripts\newusers.csv" | foreach { New-Mailbox –name $_.Name
–alias $_.Alias –UserPrincipalName $_.UPN -FirstName $_.First -LastName
$_.Last -Password $Password
–ResetPasswordOnNextLogon:$true}

The result, as shown in Figure 5, is the creation of the new mailboxes. The existence can be confirmed by viewing the mailboxes in the Exchange Management Console. (Remember to refresh the screen if you already had it open.)

Image

Figure 5. End result of multiple mailbox creation script.

Again—while this is a significant amount of work for three users, the same concept can be used to create 50 users (or 500) and can prove to be a valuable time-saver.

Other -----------------
- Windows Server 2012 Administration : Managing Printers with the Print Management Console (part 3) - Using the Print Management Console
- Windows Server 2012 Administration : Managing Printers with the Print Management Console (part 2) - Adding New Printers as Network Shared Resources
- Windows Server 2012 Administration : Managing Printers with the Print Management Console (part 1) - Configuring the Print Management Console
- Windows Server 2008 : Configuring Server Core after Installation (part 4) - Setting the Time, Date, and Time Zone , Joining a Domain
- Windows Server 2008 : Configuring Server Core after Installation (part 3) - Logging Off, Shutting Down, and Rebooting
- Windows Server 2008 : Configuring Server Core after Installation (part 2) - Restoring the Command Prompt , Renaming the Computer
- Windows Server 2008 : Configuring Server Core after Installation (part 1) - Installing Server Core
- Microsoft Exchange Server 2010 : Introducing Journaling - Implementing Journaling, Reading Journal Reports
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 5) - Creating New Rules with the Exchange Management Shell
- Microsoft Exchange Server 2010 : Setting Up Transport Rules (part 4) - Creating New Rules with the Exchange Management Console
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server