Exchange Server PowerShell (Exchange 管理外壳程序)Exchange Server PowerShell (Exchange Management Shell)

Exchange 管理外壳程序基于 Windows PowerShell 技术,并提供了功能强大的命令行接口,使 Exchange 管理任务的自动化。可以使用 Exchange 管理外壳程序来管理 Exchange 的方方面面。例如,您可以创建电子邮件帐户,创建发送连接器和接收连接器、 配置邮箱数据库属性,和管理通讯组。可以使用 Exchange 管理外壳程序来执行每一项任务会出现在 Exchange 图形管理工具,再加上不能存在 (例如,批量操作) 的事情。事实上,当您在执行某些操作 Exchange 管理员中心 (EAC)、 交换控制面板 (ECP) 或 Exchange 管理控制台 (EMC),它是在幕后操作的 Exchange 管理外壳。The Exchange Management Shell is built on Windows PowerShell technology and provides a powerful command-line interface that enables the automation of Exchange administration tasks. You can use the Exchange Management Shell to manage every aspect of Exchange. For example, you can create email accounts, create Send connectors and Receive connectors, configure mailbox database properties, and manage distribution groups. You can use the Exchange Management Shell to perform every task that's available in the Exchange graphical management tools, plus things that you can't do there (for example, bulk operations). In fact, when you do something in the the Exchange admin center (EAC), the Exchange Control Panel (ECP), or the Exchange Management Console (EMC), it's the Exchange Management Shell that does the work behind the scenes.

Exchange 命令行管理程序 还提供强大且灵活的脚本编写平台。需要大量代码行的 Visual Basic 脚本可替换为使用最少一行代码的 Exchange 命令行管理程序 命令。Exchange 命令行管理程序 提供这种灵活性的原因在于,它使用建立在 Microsoft.NET Framework 基础上的对象模型。此对象模型启用 Exchange cmdlet,以将一个命令中的输出应用到后续命令。The Exchange Management Shell also provides a robust and flexible scripting platform. Visual Basic scripts that required many lines of code can be replaced by Exchange Management Shell commands that use as little as one line of code. The Exchange Management Shell provides this flexibility because it uses an object model that's based on the Microsoft .NET Framework. This object model enables Exchange cmdlets to apply the output from one command to subsequent commands.

若要立即开始使用 Exchange 命令行管理程序,请参阅本主题后面的 Exchange 命令行管理程序文档部分。To start using the Exchange Management Shell immediately, see the Exchange Management Shell documentation section later in this topic.

除了边缘传输的所有 Exchange 服务器角色的 Exchange 管理外壳程序工作都原理How the Exchange Management Shell works on all Exchange server roles except Edge Transport

无论是使用 Exchange 管理外壳程序在本地 Exchange 服务器上还是位于全国各地的 Exchange 服务器上,远程 PowerShell 执行工作。Whether you use the Exchange Management Shell on a local Exchange server or on an Exchange server that's located across the country, remote PowerShell does the work.

当单击 Exchange 服务器上的 Exchange 管理外壳程序快捷方式时,Windows PowerShell 的本地实例执行以下步骤:When you click the Exchange Management Shell shortcut on an Exchange server, the local instance of Windows PowerShell performs the following steps:

  1. 连接到最近的 Exchange 服务器 (大多数情况下,本地 Exchange 服务器) 使用所需的 Windows PowerShell 组件调用 Windows 远程管理 (WinRM)。Connect to the closest Exchange server (most often, the local Exchange server) using a required Windows PowerShell component called Windows Remote Management (WinRM).

  2. 执行身份验证检查。Perform authentication checks.

  3. 创建远程 PowerShell 会话,以供您使用。Create a remote PowerShell session for you to use.

您只能访问与您分配的 Exchange 管理角色组和管理角色相关联的 Exchange cmdlet 以及参数。有关 Exchange 如何使用角色组和角色管理任务执行人员及任务的详细信息,请参阅PermissionsYou only get access to the Exchange cmdlets and parameters that are associated with the Exchange management role groups and management roles you're assigned. For more information about how Exchange uses role groups and roles to manage who can do what tasks, see Permissions.

远程 PowerShell 的好处是您可以在本地计算机上使用 Windows PowerShell 连接到远程 Exchange 服务器上,并在 Windows PowerShell 会话中导入 Exchange cmdlet,这样您就可以管理 Exchange。计算机的唯一要求是:A benefit of remote PowerShell is that you can use Windows PowerShell on a local computer to connect to a remote Exchange server, and import the Exchange cmdlets in the Windows PowerShell session so you can administer Exchange. The only requirements for the computer are:

  • 受支持的操作系统的 Exchange Server。A supported operating system for Exchange Server.

  • 受支持的 .NET Framework 版本。A supported version of the .NET Framework.

  • 受支持的 Windows Management Framework (WMF) 版本,包括 WinRM 和 Windows PowerShell。A supported version of the Windows Management Framework (WMF), which includes WinRM and Windows PowerShell.

有关详细信息,请参阅以下主题:For details, see the following topics:

但是,我们建议在您使用广泛管理 Exchange 2016 任何计算机上安装 Exchange 管理工具 (其中包括 Exchange 管理外壳)。没有安装的 Exchange 管理工具,您需要手动连接到远程 Exchange 服务器,您没有访问 Exchange 管理工具提供的附加功能。However, we recommend that you install the Exchange management tools (which includes the Exchange Management Shell) on any computer that you use to extensively manage Exchange 2016. Without the Exchange management tools installed, you need to connect to the remote Exchange server manually, and you don't have access to the additional capabilities that the Exchange management tools provide.

有关在不安装 Exchange 管理工具的情况下连接到 Exchange 服务器的详细信息,请参阅连接到 Exchange 服务器使用远程 PowerShellFor more information about connecting to Exchange servers without the Exchange management tools installed, see Connect to Exchange servers using remote PowerShell.

Exchange 命令行管理程序在边缘传输服务器上的工作原理How Exchange Management Shell works on Edge Transport servers

在边缘传输服务器上,Exchange 命令行管理程序 的工作方式有所不同。通常,您在外围网络中部署边缘传输服务器,可以作为独立服务器或外围 Active Directory 域的成员。On Edge Transport servers, the Exchange Management Shell works differently. You typically deploy Edge Transport servers in your perimeter network, either as stand-alone servers or as members of a perimeter Active Directory domain.

当单击 Exchange 边缘传输服务器上的 Exchange 管理外壳程序快捷方式时,Windows PowerShell 的本地实例创建本地 PowerShell 会话以供您使用。When you click the Exchange Management Shell shortcut on an Exchange Edge Transport server, the local instance of Windows PowerShell creates a local PowerShell session for you to use.

边缘传输服务器不使用管理角色或管理角色组来控制权限。本地管理员组控制谁可以在本地服务器上配置 Exchange 功能。Edge Transport servers don't use management roles or management role groups to control permissions. The local Administrators group controls who can configure the Exchange features on the local server.

有关边缘传输服务器的详细信息,请参阅Edge Transport ServersFor more information about Edge Transport servers, see Edge Transport Servers.

Exchange 命令行管理程序文档Exchange Management Shell documentation

下表提供相关主题的链接,可帮助您了解 Exchange 命令行管理程序 的使用信息。The following table provides links to topics that can help you learn about and use the Exchange Management Shell.

主题Topic 说明Description
打开 Exchange 命令行管理程序Open the Exchange Management Shell 查找并打开 Exchange 管理外壳的 Exchange 服务器或具有安装 Exchange 管理工具的计算机上。Find and open the Exchange Management Shell on an Exchange server or a computer that has the Exchange management tools installed.
使用远程 PowerShell 连接到 Exchange 服务器Connect to Exchange servers using remote PowerShell 在本地计算机上使用 Windows PowerShell 连接到 Exchange 服务器。Use Windows PowerShell on a local computer to connect to an Exchange server.
控制对 Exchange 服务器的远程 PowerShell 访问Control remote PowerShell access to Exchange servers 了解如何阻止或允许用户远程 PowerShell 访问 Exchange 服务器。Learn how to block or allow users' remote PowerShell access to Exchange servers.
查找运行任意 Exchange cmdlet 所需的权限Find the permissions required to run any Exchange cmdlet 找到该 cmdlet 的权限,您需要运行特定的 cmdlet 或一个或多个参数。Find the permissions you need to run a specific cmdlet, or one or more parameters on the cmdlet.
交换 cmdlet systaxExchange cmdlet systax 了解的结构和语法中交换 PowerShell 的 cmdlet。Learn about the structure and syntax of cmdlets in Exchange PowerShell.
收件人筛选器在 Exchange 管理外壳程序命令Recipient filters in Exchange Management Shell commands 了解 Exchange 管理外壳中的收件人筛选器。Learn about recipient filters in the Exchange Management Shell.
使用更新 ExchangeHelp 更新 Exchange PowerShell 在 Exchange 服务器上的帮助主题Use Update-ExchangeHelp to update Exchange PowerShell help topics on Exchange servers 了解如何使用更新 ExchangeHelp 更新 Exchange cmdlet 参考主题在 Exchange 服务器上的帮助。Learn how to use Update-ExchangeHelp to update help for Exchange cmdlet reference topics on Exchange servers.