IT tutorials
 
Technology
 

Using the Windows PowerShell in an Exchange Server 2007 Environment : Using EMS to Do Administrative Mailbox Tasks

12/10/2013 8:16:33 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

The Exchange Management Shell makes common mailbox management tasks such as adding, modifying, moving, and deleting mailboxes simple. The flexibility of EMS allows the administrator to easily perform tasks that would require much more time and labor if done from the Exchange Management Console.

Creating Mailboxes with EMS

Mailboxes can be created with EMS singly or in bulk. They can be created using the interactive command prompt or by specifying the required parameters from the command line. To enable a malbox using the interactive shell, simply enter:

Enable-mailbox

and answer the prompts for the missing parameters:

Supply values for the following parameters:
Database: mailbox store
Identity: companyabc\jason

The following example creates a mailbox for the existing user Jason in Mailbox Store 3 on SERVER1:

Enable-Mailbox "companyabc\jason" -database "SERVER1\mailbox store 3"

The next example demonstrates using EMS to create 1,000 users in Active Directory and create mailboxes for each user in the Test Mailbox Store on SERVER3. This single-line cmdlet is very useful in lab scenarios.

1..1000 | foreach {net user "user$_" MyPassword=01 /ADD /Domain; enable-mailbox
"user$_" -database "SERVER3\test mailbox store"}



Doing this same operation using VBScript would take many more lines of code and require much more development time.

Modifying Mailboxes with EMS

Mailbox attributes can easily be modified using EMS, as well. The following example modifies the mailbox for user Jason in the default domain to only accept emails from [email protected]:

set-Mailbox jason -AcceptMessagesOnlyFrom [email protected]

It is just as easy to make changes on many mailboxes at the same time using pipelining. Consider the following example that sets the mailbox quota for all user mailboxes at 250MB:

get-Mailbox | set-Mailbox -StorageQuota 250mb

In this example, we use the –OrganizationalUnit parameter of the Get-Mailbox cmdlet to set the maximum message size that users in the Accounting OU can send to 10MB:

get-Mailbox -OrganizationalUnit "Test Users" | set-Mailbox -MaxSendSize 10mb


Moving Mailboxes Using EMS

Moving mailboxes with the Exchange Management Shell is very easy and powerful. A simple move of a mailbox from one database to another on the same server is accomplished like this:

Move-Mailbox Claire –TargetDatabase "accounting database"

EMS knows the name of all the databases in the organization. If there is more than one database with the same name, EMS moves the database to the first alphabetic server with that database name. To target a specific server, explicitly name the server in the TargetDatabase parameter. For example:

Move-Mailbox Claire –TargetDatabase "SERVER2\accounting database"

More complex moves are achieved just as easily from the Exchange Management Shell command line. In the following example, the mailbox is moved from the companyabc.org forest to the companyabc.com forest.

Move-Mailbox -SourceForest company123.org -TargetForest companyabc.com–targetDatabase "mailbox store 9" company123\lilly


Of course, a realm trust must be established prior to moving the mailbox.

Disabling Mailboxes with EMS

Administrators do not delete mailboxes in Exchange 2007—they disable them. Disabling a mailbox detaches the mailbox of an existing user or inetOrgPerson and removes all of that object’s Exchange attributes from Active Directory. The mailbox is truly deleted by Exchange during the online maintenance cycle after exceeding the retention time.

The following example disables a mailbox of a user in the companyabc.com domain:

Disable-Mailbox companyabc\claire

The next example shows how to delete all the mailboxes in the “Test Database” mail store so that it can be decommissioned:

get-Mailbox -database "test database" | disable-Mailbox –whatif

The –WhatIf switch in the preceding example runs the task in Read-only mode, allowing the administrator to see what would happen by running this command.

Another related command is Remove-Mailbox. This command removes the user account that is associated with a particular mailbox in Active Directory and processes the associated, disconnected mailbox as directed by the specified parameters.

Remove-Mailbox -MailboxDatabase "Sales Database" "companyabc\storage group 2\jason"			  
 
Others
 
- Using the Windows PowerShell in an Exchange Server 2007 Environment : Managing Cmdlets
- Using the Windows PowerShell in an Exchange Server 2007 Environment : Creating Your Own Cmdlet
- PowerShell for Microsoft SharePoint 2010 : Special Operators
- PowerShell for Microsoft SharePoint 2010 : Type Operators
- PowerShell for Microsoft SharePoint 2010 : Redirection Operators
- PowerShell for Microsoft SharePoint 2010 : Logical Operators
- PowerShell for Microsoft SharePoint 2010 : Comparison Operators
- PowerShell for Microsoft SharePoint 2010 : Assignment Operators
- PowerShell for Microsoft SharePoint 2010 : Arithmetic Operators
- Microsoft Systems Management Server 2003 : Updating Collections (part 3) - Collection Evaluator Update Process Flow, Status Messages
 
 
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
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us