Applies to: Exchange Server 2007 SP3, Exchange Server
2007 SP2, Exchange Server 2007 SP1, Exchange Server 2007
Topic Last Modified: 2007-07-18
The Exchange Management Shell, built on Microsoft Windows PowerShell technology, provides administrators a powerful command-line interface that they can use to administer Microsoft Exchange Server 2007. With the Exchange Management Shell, administrators can manage every aspect of Exchange 2007. They can enable new e-mail accounts and configure Simple Mail Transfer Protocol (SMTP) connectors, store database properties, transport agents, and more. The Exchange Management Shell can perform every task that can be performed by Exchange Management Console in addition to tasks that can't be performed in the Exchange Management Console. In fact, when a task is performed in the Exchange Management Console, the same command is made available to the Exchange Management Shell and is called to process the request. For more information about the new Exchange Management Console, see New Administration Functionality in the Exchange Management Console.
Figure 1 illustrates the design and layout of the Exchange Management Shell.
The Exchange Management Shell is a snap-in that relies on Windows PowerShell. Therefore, Windows PowerShell must be installed on the computer that will be running the Exchange Management Shell. To install Windows PowerShell, you must install the Microsoft .NET 2.0 Framework on the computer that will run Windows PowerShell. For information about how to download the .NET Framework, see the Microsoft .NET Framework Developer Center.
New Features in the Exchange Management Shell
The Exchange Management Shell provides a robust and flexible scripting platform that can reduce the complexity of current Microsoft Visual Basic scripts. What previously took hundreds of lines in Visual Basic scripts can now be done by using as little as one line of code in the Exchange Management Shell.
The Exchange Management Shell provides this flexibility because it doesn't use text as the basis for interaction with the system. It uses an object model that is based on the Microsoft .NET platform. This object model enables the shell commands to apply the output from one command to subsequent commands when they are run.
The following are key features of the Exchange Management Shell:
- Command-line interface The command-line
interface lets you quickly and easily access and modify
Exchange 2007 features and their values. It also gives you the
flexibility to easily perform tasks in bulk that would have taken
many lines of code or hours of work to apply changes through
Exchange System Manager.
- Piping of data between
commands Pipelining makes you even more
productive when you administer Exchange 2007 through the
Exchange Management Shell. Pipelining helps you use output from one
command as input in other commands. This lets you easily perform
bulk operations based on criteria applied to filtering commands
that then supply the objects to be modified to commands down the
"pipe". This feature is a primary reason why the Exchange
Management Shell makes it possible to reduce dozens of lines of
code to a single chain of commands.
- Structured data support Because all
output from all the commands in the Exchange Management Shell is an
object, all output from the commands can be acted on and processed
by other commands by using little or no manipulation. Commands
in a particular feature set accept output from other commands in
that same feature set, without manipulation.
- Extensive support for scripting When
you want to perform complex processes, automate functions for Help
Desk account management, monitor performance, or enable other
automated administrative tasks, the Exchange Management Shell
provides a powerful object model environment based on the .NET
- Safe scripting To enable a smooth
transition from a test environment to production or just to verify
that your commands work correctly before you apply them to actual
data, the Exchange Management Shell lets you test your commands to
make sure they do what you want. You can verify the changes to be
made, confirm that you want to continue, and verify that the
process will succeed from end to end.
- Access cmd.exe commands The Exchange
Management Shell provides transparent access to the commands that
are available through the command prompt (Cmd.exe). You can even
take the output of Cmd.exe commands and perform actions based on
that output, or integrate that output into the data that you
provide to another command.
- Trusted scripts To improve security,
the Exchange Management Shell requires that all scripts are
digitally signed before they are allowed to run. This requirement
prevents malicious parties from inserting a harmful script in the
Exchange Management Shell. Only scripts that you specifically trust
are allowed to run. This precaution helps protect you and your
- Profile customization While the default
installation of the Exchange Management Shell gives you a fully
featured and easy-to-use interface, you may want to add shortcuts
to the commands that you frequently use. You might also want to
adjust the interface to suit your tasks. You can edit your personal
Exchange Management Shell profile. This lets you control how your
interface is configured and what commands automatically run when
the Exchange Management Shell starts. Profile customization lets
you assign scripts to aliases that you frequently use in the daily
administration of your Exchange 2007 organization.
- Extensible shell support If you don't
like the way that data is displayed or if, for example, you can't
remember which collections use the Count property and which
collections use the Length property, you can easily make
adjustments. The Exchange Management Shell uses XML to let you
modify many aspects of its behavior. Developers can create new
commands to integrate with the built-in Exchange Management Shell
commands. This extensibility gives you more control over your
Exchange 2007 organization and helps you streamline
For More Information
For more information about how to use the Exchange Management Shell, see Using the Exchange Management Shell.
For a list of frequently used Exchange Management Shell command examples that are organized by administrative functions, such as recipient management and transport configuration, see Exchange Management Shell Quick Reference.