- Подключение к серверам Exchange Server с помощью удаленной оболочки PowerShell
- Что нужно знать перед началом работы?
- Подключение к удаленному серверу Exchange
- Как убедиться, что все получилось?
- См. также
- Запустите командную консоль Exchange
- Что нужно знать перед началом работы?
- Откройте оболочку управления Exchange в центре Windows Server 2019
- Откройте оболочку управления Exchange в Windows Server 2016 или Windows 10
- Открытие консоли управления Exchange в Windows Server 2012 R2 или Windows 8.1
- Открытие консоли управления Exchange в Windows Server 2012
- About the Exchange Online PowerShell V2 module
- Report bugs and issues for the EXO V2 module
- How the EXO V2 module works
- Install and maintain the EXO V2 module
- Supported operating systems for the EXO V2 module
- Apple macOS
- Linux
- Windows
- Prerequisites for the EXO V2 module
- Install the EXO V2 module
- Update the EXO V2 module
- Troubleshoot installing the EXO V2 module
- Uninstall the EXO V2 module
- Properties and property sets in the EXO V2 module
- Release notes
- Current release: Version 2.0.4
- Previous releases
- Version 2.0.3
- Version 1.0.1
- Version 0.4578.0
- Version 0.4368.1
- Version 0.3582.0
- Version 0.3555.1
Подключение к серверам Exchange Server с помощью удаленной оболочки PowerShell
Если на вашем локальном компьютере не установлены средства управления Exchange, вы можете с помощью Windows PowerShell создать удаленный сеанс PowerShell на сервере Exchange Server. Эта простая процедура состоит из трех шагов: сначала вы вводите учетные данные, затем предоставляете необходимые параметры подключения, после чего импортируете командлеты Exchange в локальный сеанс Windows PowerShell, чтобы использовать их в дальнейшем.
Рекомендуем использовать командную консоль Exchange на любом компьютере, предназначенном для активного администрирования серверов Exchange Server. Командную консоль Exchange можно получить, установив средства управления Exchange. Дополнительные сведения см. в статьях Установка средств управления Exchange Server и Открытие командной консоли Exchange. Для получения дополнительных сведений о командной консоли Exchange см. статью Exchange Server PowerShell (командная консоль Exchange).
Командлет Get-ExchangeCertificate не полностью поддерживает удаленную оболочку PowerShell. Вместо этого мы рекомендуем использовать командную консоль Exchange, чтобы получить все свойства этого командлета.
Что нужно знать перед началом работы?
Предполагаемое время для завершения: менее пяти минут.
После подключения управление наличием доступа к командлетам и параметрам осуществляется путем управления доступом на основе ролей (RBAC). Дополнительные сведения см. в статье Разрешения Exchange Server.
Ниже приведены версии Windows, которые можно использовать.
- Windows 10
- Windows 8.1
- Windows Server 2019
- Windows Server 2016
- Windows Server 2012 или Windows Server 2012 R2
- Windows 7 с пакетом обновления 1 (SP1) *
- Windows Server 2008 R2 с пакетом обновления 1 (SP1) *
* Эта версия Windows больше не поддерживается; исключением является только использование на виртуальных машинах Azure. Чтобы использовать эту версию Windows, необходимо установить Microsoft .NET Framework 4.5 или более позднюю версию, а затем обновленную версию Windows Management Framework: 3.0, 4.0 или 5.1 (только одну). Дополнительные сведения см. в статьях Установка .NET Framework, Windows Management Framework 3.0, Windows Management Framework 4.0 и Windows Management Framework 5.1.
Чтобы запускать сценарии, необходимо настроить Windows PowerShell. По умолчанию это приложение не настроено. При попытке подключения появится указанная ниже ошибка.
Файлы невозможно загрузить, поскольку выполнение сценариев в этой системе отключено. Предоставьте действительный сертификат для подписи файлов.
Чтобы требовать подпись надежного издателя для всех сценариев PowerShell, загружаемых из Интернета, выполните следующую команду в окне Windows PowerShell с повышенными привилегиями (окно Windows PowerShell, которое открывается с помощью параметра Запуск от имени администратора).
Дополнительные сведения о политиках выполнения см. в статье Сведения о политиках выполнения.
Возникли проблемы? Обратитесь за помощью к участникам форума Exchange Server.
Подключение к удаленному серверу Exchange
На локальном компьютере откройте Windows PowerShell и запустите следующую команду:
В открывшемся диалоговом окне Запрос учетных данных Windows PowerShell введите имя участника-пользователя (UPN) (например, chris@contoso.com ) и пароль, а затем нажмите кнопку OK.
Замените полным доменным именем сервера Exchange Server (например, mailbox01.contoso.com ) и выполните следующую команду:
Примечание. Значением ConnectionUri является http , а не https .
Выполните следующую команду:
По завершении настройки отключите удаленный сеанс PowerShell. Если закрыть окно Windows PowerShell, не выполнив отключение сеанса, можно исчерпать лимит доступных сеансов удаленной среды PowerShell. К тому же, придется дождаться завершения сеанса. Чтобы отключить удаленный сеанс PowerShell, выполните следующую команду:
Как убедиться, что все получилось?
После шага 3 командлеты Exchange импортируются в локальный сеанс Windows PowerShell и отображаются в индикаторе выполнения. Если при этом не возникают ошибки, подключение успешно установлено. Чтобы выполнить быструю проверку, запустите командлет Exchange (например, Get-Mailbox) и просмотрите результаты его выполнения.
Если возникают ошибки, просмотрите список возможных причин ниже.
Распространенная проблема — неправильный пароль. Еще раз повторите три описанные выше действия, уделив особое внимание действию 1 — вводу имени пользователя и пароля.
Для учетной записи, которую вы используете для подключения к серверу Exchange Server, необходимо включить удаленный доступ к PowerShell. Дополнительные сведения см. в статье Управление удаленным доступом к PowerShell для серверов Exchange Server.
Между локальным компьютером и сервером Exchange Server необходимо открыть трафик для TCP-порта 80. Вполне вероятно, что он уже открыт, но в этом следует убедиться, если в вашей организации действует политика ограниченного сетевого доступа.
См. также
В этой статье используются командлеты Windows PowerShell. Дополнительные сведения об этих командлетах см. в следующих статьях.
Запустите командную консоль Exchange
При открывании командной оболочки Exchange можно выполнять административные задачи Exchange Server из командной строки. Командную консоль Командная консоль Exchange можно открыть из следующих расположений:
напрямую на сервере Exchange или в сеансе удаленного рабочего стола;
На локальном компьютере после установки средств управления Exchange. Дополнительные сведения см. в рублях Install the Exchange management tools.
Что нужно знать перед началом работы?
Предполагаемое время выполнения процедуры: менее 1 минуты.
Чтобы сделать процедуры в этой статье, вам необходимо на должно быть назначено по крайней мере одну роль управления (как правило, с помощью членства в группе ролей). После подключения управление наличием доступа к командлетам и параметрам осуществляется путем управления доступом на основе ролей (RBAC).
Дополнительные сведения см. в статье Разрешения Exchange Server.
Если вы хотите запустить оболочку управления Exchange из локальной установки средств управления Exchange, необходимо учитывать удаленный доступ к PowerShell для учетной записи пользователя. По умолчанию пользователям разрешено использовать удаленный PowerShell для подключения к серверу Exchange. Тем не менее, удаленный доступ к PowerShell можно заблокировать. Дополнительные сведения см. в статье Управление удаленным доступом к PowerShell для серверов Exchange Server.
Возникли проблемы? Попросите о помощи на Exchange Server форумах.
Откройте оболочку управления Exchange в центре Windows Server 2019
Серверы почтовых ящиков: запустите следующую команду из командной подсказки:
Edge Transport servers: Run the following commands from a Command Prompt. Обратите внимание, что это две отдельные команды в одной строке для простоты копирования и работы:
Откройте оболочку управления Exchange в Windows Server 2016 или Windows 10
Нажмите > кнопку Microsoft Exchange Server 2016 > Exchange Management Shell.
Открытие консоли управления Exchange в Windows Server 2012 R2 или Windows 8.1
При установке Exchange на Windows Server 2012 R2 или средств управления Exchange на Windows 8.1 ярлык exchange Management Shell автоматически не прикрепляется к экрану Начните.
Чтобы закрепить ярлык на начальном экране, выполните следующие действия.
На начальном экране откройте представление приложений, щелкнув стрелку вниз рядом с левым нижним углом или проведя пальцем вверх посередине экрана.
Ярлык командной консоли Exchange входит в группу Microsoft Exchange Server 2016. Когда вы найдете ярлык, щелкните его правой кнопкой мыши или нажмите и удерживайте его и выберите команду Закрепить на начальном экране. Чтобы закрепить его на панели задач рабочего стола, выберите команду Закрепить на панели задач.
Чтобы с помощью чудо-кнопки «Поиск» найти и запустить Командная консоль Exchange, используйте один из способов, описанных в следующем разделе.
Открытие консоли управления Exchange в Windows Server 2012
При установке Exchange на Windows Server 2012 ярлык exchange Management Shell следует автоматически прикрепить к экрану Начните.
Если это не так или вы хотите быстро найти и запустить Командная консоль Exchange, используйте один из указанных ниже способов.
На начальном экране щелкните пустую область и введите Exchange Management Shell. Когда ярлык появится в результатах поиска, выберите его.
На рабочем столе или на начальном экране нажмите клавиши Windows+Q. В чудо-кнопке «Поиск» введите Exchange Management Shell. Когда ярлык появится в результатах, выберите его.
На рабочем столе или на начальном экране расположите курсор в правом верхнем углу экрана или проведите пальцем влево от правого края экрана, чтобы появились чудо-кнопки. Нажмите чудо-кнопку «Поиск», а затем введите Exchange Management Shell. Когда ярлык появится в результатах, выберите его.
При использовании подключения к удаленному рабочему столу может потребоваться использовать один из следующих методов для отображения чудо-кнопки «Поиск» на удаленном сервере Exchange, а не на локальном компьютере.
Open Remote Desktop Connection and click Show Options > Local Resources tab > Apply Windows key combinations. The default value is Only when using the full screen, but you can change it to On the remote computer.
Подключившись к удаленному серверу Exchange, с помощью панели подключения, которая отображается в верхней части экрана, откройте чудо-кнопку «Поиск» или начальный экран Exchange, щелкнув стрелку вниз и выбрав Чудо-кнопки или Пуск.
About the Exchange Online PowerShell V2 module
The Exchange Online PowerShell V2 module (abbreviated as the EXO V2 module) uses modern authentication and works with multi-factor authentication (MFA) for connecting to all Exchange-related PowerShell environments in Microsoft 365: Exchange Online PowerShell, Security & Compliance PowerShell, and standalone Exchange Online Protection (EOP) PowerShell.
For connection instructions using the EXO V2 module, see the following articles:
The rest of this article explains how the module works, how to install and maintain the module, and the optimized Exchange Online cmdlets that are available in the module.
Report bugs and issues for the EXO V2 module
When you report an issue, be sure to include the log files in your email message. To generate the log files, replace
with the output folder you want, and run the following command:
How the EXO V2 module works
The module contains a small set of exclusive Exchange Online PowerShell cmdlets that are optimized for bulk data retrieval scenarios (think: thousands and thousands of objects). When you first open the module, you’ll only see these exclusive cmdlets. After you connect to your Exchange Online organization, you’ll see all of the familiar cmdlets that are available in Exchange Online PowerShell.
The module use modern authentication for all cmdlets. You can’t use Basic authentication in the EXO V2 module; however, you still need to enable the Basic authentication setting in WinRM as explained later in this article.
The Exchange Online cmdlets in the EXO V2 module are meant to replace their older, less efficient equivalents, but the equivalent cmdlets are still available (after you connect).
The improved Exchange Online PowerShell cmdlets that are only available in the EXO V2 module are listed in the following table:
EXO V2 module cmdlet | Older related cmdlet |
---|---|
Get-EXOMailbox | Get-Mailbox |
Get-EXORecipient | Get-Recipient |
Get-EXOCasMailbox | Get-CASMailbox |
Get-EXOMailboxPermission | Get-MailboxPermission |
Get-EXORecipientPermission | Get-RecipientPermission |
Get-EXOMailboxStatistics | Get-MailboxStatistics |
Get-EXOMailboxFolderStatistics | Get-MailboxFolderStatistics |
Get-EXOMailboxFolderPermission | Get-MailboxFolderPermission |
Get-EXOMobileDeviceStatistics | Get-MobileDeviceStatistics |
The connection-related cmdlets that are available in the EXO V2 module are listed in the following table:
EXO V2 module cmdlet | Older related cmdlet | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Connect-ExchangeOnline | Connect-EXOPSSession Miscellaneous Exchange Online cmdlets that happen to be in the EXO V2 module are listed in the following table:
Install and maintain the EXO V2 moduleYou can download the EXO V2 module from the PowerShell gallery at https://www.powershellgallery.com/packages/ExchangeOnlineManagement/. The procedures in this section explain how to install, update, and uninstall the EXO V2 module. Supported operating systems for the EXO V2 moduleThe latest version of the EXO V2 module is officially supported in PowerShell 7 on Windows, Linux, and Apple macOS. Specifically, version 2.0.4 or later of the EXO V2 module is supported in PowerShell 7.0.3 or later. For more information about PowerShell 7, see Announcing PowerShell 7.0. Apple macOSThe EXO V2 module is supported in the following versions of macOS:
For instructions on installing PowerShell 7 on macOS, see Installing PowerShell on macOS. LinuxThe EXO V2 module is officially supported in the following distributions of Linux: If you have trouble using the EXO V2 module on other distributions of Linux, send email to the following address: exocmdletpreview[at]service[dot]microsoft[dot]com . The email address is purposefully obfuscated to avoid spam. For instructions on installing PowerShell 7 on Linux, see Installing PowerShell on Linux. WindowsAll versions of the EXO V2 module are supported in Windows PowerShell 5.1. PowerShell 7 on Windows requires version 2.0.4 or later of the EXO V2 module. The EXO V2 module is supported in the following versions of Windows:
1 This version of Windows has reached its end of support, and is now supported only in Azure virtual machines. 2 This version of Windows doesn’t support version 2.0.4 or later of the EXO V2 module. Only version 2.0.3 or earlier is supported. 3 Windows PowerShell 5.1 on this version of Windows requires the Microsoft .NET Framework 4.5 or later and the Windows Management Framework 5.1. For more information, see Windows Management Framework 5.1. 4 PowerShell 7 on this version of Windows requires the Windows 10 Universal C Runtime (CRT). Prerequisites for the EXO V2 moduleThe settings described in this section are required in all versions of PowerShell on all operating systems. PowerShell needs to be configured to run scripts, and by default, it isn’t. You’ll get the following error when you try to connect:
To require all PowerShell scripts that you download from the internet are signed by a trusted publisher, run the following command in an elevated PowerShell window (a PowerShell window you open by selecting Run as administrator): For more information about execution policies, see About Execution Policies. WinRM needs to allow Basic authentication (it’s enabled by default). We don’t send the username and password combination, but the Basic authentication header is required to send the session’s OAuth token, since the client-side WinRM implementation has no support for OAuth. Note: You must temporarily enable WinRM to run the following commands. You can enable WinRM by running the command: winrm quickconfig . To verify that Basic authentication is enabled for WinRM, run this command in a Command Prompt (not in PowerShell): If you don’t see the value Basic = true , you need to run this command in a Command Prompt (not in PowerShell) to enable Basic authentication for WinRM: Note: If you’d rather run the command in PowerShell, enclose this part of the command in quotation marks: ‘@ If Basic authentication for WinRM is disabled, you’ll get this error when you try to connect:
Having problems? Ask for help in the Exchange forums. Visit the forums at: Exchange Online, or Exchange Online Protection. Install the EXO V2 moduleTo install the EXO V2 module for the first time, complete the following steps: Install or update the PowerShellGet module as described in Installing PowerShellGet. Close and re-open the Windows PowerShell window. Now you can use the Install-Module cmdlet to install the EXO V2 module from the PowerShell Gallery. Typically, you’ll want the latest public version of the module, but you can also install a Preview version if one is available. To install the latest public version of the module, run one of the the following commands: In an elevated PowerShell window (all users): Only for the current user account: To install a Preview version of the module, replace Only for the current user account: When you’re finished, enter Y to accept the license agreement. For detailed syntax and parameter information, see Install-Module. Update the EXO V2 moduleIf the module is already installed on your computer, you can run the following commands to see the version that’s currently installed and update it to the latest version from the PowerShell Gallery: To see the version of the module that’s currently installed, run the following commands: You can use the Update-Module cmdlet to update the EXO V2 module from the PowerShell Gallery. Typically, you’ll want the latest public version of the module, but you can also upgrade to a Preview version if one is available. To upgrade to the latest public version of the module, run one of the following commands based on how you originally installed the module (in an elevated PowerShell window vs. Scope CurrentUser ): In an elevated PowerShell window (all users): Only for the current user account: To upgrade to a Preview version of the module, replace Only for the current user account: When you’re finished, enter Y to accept the license agreement. To confirm that the update was successful, run the following commands to check the version information of the module that’s installed: For detailed syntax and parameter information, see Update-Module. Troubleshoot installing the EXO V2 moduleIf you receive the following error:
Update your installation of the PowerShellGet module to the latest version as described in Installing PowerShellGet. Be sure to close and re-open the PowerShell window before you attempt to update the ExchangeOnlineManagement module again. As of April 2020, the PowerShell Gallery only supports connections using TLS 1.2 or later. For more information, see PowerShell Gallery TLS Support. To check your current settings in the Microsoft .NET Framework, run the following command in Windows PowerShell: As described in the PowerShell Gallery TLS Support article, to temporarily change the security protocol to TLS 1.2 to install the PowerShellGet or ExchangeOnlineManagement modules, run the following command in Windows PowerShell before you install the module: To permanently enable strong cryptography in the Microsoft .NET Framework version 4.x or later, run one of the following commands based on your Windows architecture: For more information, see SchUseStrongCrypto. Uninstall the EXO V2 moduleTo uninstall the module, run one of the following commands based on how you originally installed the module (in an elevated PowerShell window vs. Scope CurrentUser ): In an elevated PowerShell window (all users): Only for the current user account: For detailed syntax and parameter information, see Uninstall-Module. Properties and property sets in the EXO V2 moduleTraditional Exchange Online cmdlets return all possible object properties in their output, including many properties that are often blank or aren’t interesting in many scenarios. This behavior causes degraded performance (more server computation and added network load). You rarely (if ever) need the full complement of properties in the cmdlet output. The Get-EXO* cmdlets in the module have categorized output properties. Instead of giving all properties equal importance and returning them in all scenarios, we’ve categorized specific related properties into property sets. Simply put, these property sets are buckets of two or more related properties on the cmdlet. In the biggest and most used Get-EXO* cmdlets: Property sets are controlled by the following parameters:
You can use the PropertySets and Properties parameters together in the same command. We’ve also included a Minimum property set that includes a bare minimum set of required properties for the cmdlet output (for example, identity properties). The properties in the Minimum property sets are also described in Property sets in Exchange Online PowerShell V2 cmdlets.
Either way, the cmdlet output will contain far fewer properties, and the time it takes to return those results will be much faster. For example, after you connect to Exchange Online PowerShell, the following example returns only the properties in the Minimum property set for the first ten mailboxes. In contrast, the output of the same Get-Mailbox command would return at least 230 properties for each of the first ten mailboxes. Although the PropertySets parameter accepts the value All, we highly discourage using this value to retrieve all properties, because it slows down the command and reduces reliability. Always use the PropertySets and Properties parameters to retrieve the minimum number of properties that are required for your scenario. For more information about filtering in the EXO V2 module, see Filters in the Exchange Online V2 module. Release notesUnless otherwise noted, the current release of the EXO V2 module contains all features of previous releases. Current release: Version 2.0.4PowerShell 7 is officially supported in Windows, Linux, and Apple macOS as described in the Prerequisites for the EXO V2 module section in this article. The EXO V2 module in PowerShell 7 supports browser-based single sign-on (SSO) and other sign in methods. For more information, see PowerShell 7 log in experiences. The Get-UserAnalyticsConfig and Set-UserAnalyticsConfig cmdlets have been replaced by the Get-MyAnalyticsConfig and Set-MyAnalyticsConfig.Additionally, you can configure access at feature level. For more information, see Configure MyAnalytics. Real-time policy and security enforcement in all user based authentication. Continuous Access Evaluation (CAE) has been enabled in EXO V2 Module. Read more about CAE here. The LastUserActionTime and LastInteractionTime properties are now available in the output of the Get-EXOMailboxStatistics cmdlet. The interactive sign-in process now uses a more secure method to fetch access tokens using safe reply URLs. Previous releasesVersion 2.0.3
Version 1.0.1
50 minutes and threw a «Cmdlet not found» error due to a bug in auto-reconnect logic. Version 0.4578.0
Version 0.4368.1
Version 0.3582.0
Version 0.3555.1
|