Exchange Management Shell Concepts
The Exchange Management Shell in Microsoft Exchange Server 2010 provides commands based on the Windows PowerShell platform that are used to manage an Exchange Server installation. This section describes Exchange Management Shell features that are important for creating Exchange Management Shell tools. It does not provide information about planning, configuring, or maintaining Exchange servers. For more information about how to implement and administer Exchange 2010, see the Exchange Server TechCenter.
The Exchange Management Shell enables you to create two kinds of applications: command line scripts that work within the Windows PowerShell environment, and managed applications that expose the Exchange Management Shell cmdlets through a managed interface. Managed applications enable you to create a standard Windows or Web-based user interface to administer an Exchange server. For an example that shows how to use Exchange Management Shell cmdlets from managed code, see Calling Exchange Management Shell Cmdlets from Managed Code. For more information about using Windows PowerShell to create scripts, see Windows PowerShell on MSDN.
Do not load the Microsoft Exchange 2010 Management snap-in into the runspace on computers that are running applications that automate Exchange Management Shell cmdlets. The application should instead create a remote runspace, as shown in Calling Exchange Management Shell Cmdlets from Managed Code.
The Exchange Management Shell uses Remote PowerShell features for all commands, even commands that are run on the local server. As a result, all responses from Exchange Management Shell cmdlets are serialized XML. This means that although the response object indicates the Exchange object type that was used to generate the response, the response object cannot be cast to the Exchange object type; instead, you must use the property bag that is exposed by the response object to obtain the values from the Exchange object type.
The property bag in the response object contains a key/value pair for each public property or method in the Exchange object type. The response object contains the name of the underlying Exchange object type; you can use this name to determine the Exchange object type that is represented by the response object so that you can extract the appropriate property. Each value in the property bag also includes type information so that you can cast the property value to the appropriate managed type.