【发布时间】:2021-01-13 15:10:41
【问题描述】:
我尝试按照https://docs.microsoft.com/de-de/powershell/exchange/connect-to-exchange-online-powershell?view=exchange-ps 上的说明进行操作,但它们似乎不适用于 Linux:
$ pwsh
PowerShell 7.1.0
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /home/info> Install-Module -Name ExchangeOnlineManagement
PS /home/info> $O365Credential = Get-Credential
PowerShell credential request
Enter your credentials.
User: john.doe@mydomain.com
Password for user john.doe@mydomain.com: ***********
PS /home/info> Connect-ExchangeOnline -Credential $UserCredential ---------------------------------------------------------------------------- The module allows access to all existing remote PowerShell (V1) cmdlets in addition to the 9 new, faster, and more reliable cmdlets.
|--------------------------------------------------------------------------|
| Old Cmdlets | New/Reliable/Faster Cmdlets |
|--------------------------------------------------------------------------|
| Get-CASMailbox | Get-EXOCASMailbox |
...
----------------------------------------------------------------------------
New-ExoPSSession: /home/info/.local/share/powershell/Modules/ExchangeOnlineManagement/2.0.3/ExchangeOnlineManagement.psm1:426
Line |
426 | … PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
| PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. .
因为无法在 Linux 系统上运行 System.Windows.Forms 而失败。
还有其他方法可以在 Linux 上从 Powershell 连接到 Exchange?
【问题讨论】:
标签: linux powershell office365