Sunday, January 31, 2010

Exchange Management Shell Facts

The Exchange Management Shell (also referred to as the Exchange PowerShell) is the primary platform for all administration (the graphical interface is simply running atop of the command shell). You should know the following about the Exchange Management Shell:

  • The PowerShell must be installed before Exchange 2007 is fully installed, then extensions are installed to the PowerShell during the Exchange 2007 installation to create the Exchange 2007 PowerShell environment.
  • To manage your Exchange organization, make sure you load the Exchange Management Shell, not Microsoft Window's PowerShell.
  • The Exchange.ps1 file includes setup for the PowerShell.
Management using the shell is done by typing cmdlets.
  • Cmdlets use a verb + noun-based syntax, for example: Get-AcceptedDomain.
  • Commands are followed by one or more options. Options are identified by a hyphen and are typically followed by data. For example, Get-Mailbox -Server Server1 returns a list of mailboxes on Server1.
  • To see the options available with a command, type help followed by the command.
  • To get help within an environment, type get-help. Use the -detailed option with this command to get even more information.
  • The tab completion feature automatically points you to the most likely command if you only enter part of a command then press tab. If you're not sure what the command is, or only know part of it, use tab completion to see options starting with the letters you have typed.
The following table lists the basic set of Management Shell commands:

Command Description
Set Set modifies the properties of an existing Exchange 2007 object.
Get Get retrieves information about a particular Exchange 2007 object. Pipe the command to the Format-List cmdlet to tell it to return verbose information when you run a command.
New New creates a new Exchange 2007 object.
Excommand Excommand lists all available commands that relate to Exchange Server 2007.
Move Move relocates the specified Exchange 2007 object from one container or server to another.
Disable Disable sets the Enabled status of the specified Exchange 2007 object to $False, which prevents the object from processing data even though the object exists.
Enable Enable sets the Enabled status of the specified Exchange 2007 object to $True, which enables the object to process data.
Install Install installs a new object or feature on an Exchange 2007 server.
Uninstall Uninstall removes an object or feature from an Exchange 2007 server.
Remove Remove deletes the specified Exchange 2007 object.
Test Test tests specific Exchange 2007 components and provides log files that you can examine.
Use pipelining (also called piping) to string together the actions of two or more cmdlets. Output from the first cmdlet is fed into the second cmdlet (and so on). For example, the following cmdlet gets a list of mailboxes on a server, then moves all mailboxes to a new server:
Get-Mailbox -Server Mail1 | Move-Mailbox -TargetDatabase Mail2\Executives
When you execute a Get command, a default set of values is returned and the content is displayed in a specific order. Use the following cmdlets in combination with the Get command to format the output:
  • Use Format-List (fl) to take input from the pipeline and output a vertical columned list of all the specified properties of each object. This option is similar to the verbose option for command prompt commands. You can also follow fl with a list of properties to show only the desired properties.
  • Use Format-Table to display items in a table format with label headers and columns of property data.
  • Use GroupBy to group output by a specified property.
  • Use Property to specify which properties you wish to be displayed.
  • Use Sort-Object to sort information using a specific order.

By Unknown with No comments

0 komentar:

Post a Comment