Share via

EXO Cmdlet issue

Anonymous
2024-10-17T11:42:14+00:00

When connecting to Exchange Online and running an EXO command I am seeing some strange errors which cause the connection to Exchange online to fail.

connect-exchangeonline


This V3 EXO PowerShell module contains new REST API backed Exchange Online cmdlets which d
oesn't require WinRM for Client-Server communication. You can now run these cmdlets after
turning off WinRM Basic Auth in your client machine thus making it more secure.

Unlike the EXO* prefixed cmdlets, the cmdlets in this module support full functional parit
y with the RPS (V1) cmdlets.

V3 cmdlets in the downloaded module are resilient to transient failures, handling retries
and throttling errors inherently.

REST backed EOP and SCC cmdlets are also available in the V3 module. Similar to EXO, the c
mdlets can be run without WinRM basic auth enabled.

For more information check https://aka.ms/exov3-module

Get-EXOMailbox (email address removed)

Get-EXOMailbox : The underlying connection was closed: An unexpected error occurred on a
receive.
At line:1 char:1

  • Get-EXOMailbox email address removed for privacy reasons
  • CategoryInfo : ProtocolError: (:) [Get-EXOMailbox], DataServiceTransportE
    xception
  • FullyQualifiedErrorId : The underlying connection was closed: An unexpected error
    occurred on a receive.,Microsoft.Exchange.Management.RestApiClient.GetExoMailbox

Now I need to open a new powershell window and reconnect. I try to run a diffrent command:

Get-EXOMailboxStatistics (email address removed)

Get-EXOMailboxStatistics : The underlying connection was closed: An unexpected error
occurred on a receive.. The underlying connection was closed: An unexpected error
occurred on a receive.. The specified value is not valid in the 'SslProtocolType'
enumeration.
Parameter name: sslProtocolType.
At line:1 char:1

  • Get-EXOMailboxStatistics email address removed for privacy reasons
  • CategoryInfo : ProtocolError: (:) [Get-EXOMailboxStatistics], Exception
  • FullyQualifiedErrorId : One or more errors occurred.,Microsoft.Exchange.Management
    .RestApiClient.GetExoMailboxStatistics

There was a suggestion in a diffrent form to connect to security and compliance first.. That did not work.

Any ideas?

Microsoft 365 and Office | Install, redeem, activate | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-10-22T09:11:14+00:00

    Hi Dave McDonald DFO ,

    Good day.

    Is better if you can try contacting Get support - Microsoft 365 admin | Microsoft Learn the support team will have access to assist remotely to check the versions that work on your case and collect logs to investigate the issue from the back end.

    I hope this helps let me know if this is contrary to what you need, I would still be helpful to answer more of your questions .

    Best Regards

    Community Moderator

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-10-17T14:38:17+00:00

    So here's the status.

    Update the ExchangeOnlineManagement Module:

    Here is a list of all modules installed:

    Version              Name                                Repository           Description

    -------              ----                                ----------           -----------

    3.0.7                ActiveDirectoryObjectPicker         PSGallery            Tulpep.A...

    3.6.0                ExchangeOnlineManagement            PSGallery            This is ...

    2.23.0               Microsoft.Graph                     PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Applications        PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Authentication      PSGallery            Microsof...

    2.23.0               Microsoft.Graph.BackupRestore       PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Bookings            PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Calendar            PSGallery            Microsof...

    2.23.0               Microsoft.Graph.ChangeNotifications PSGallery            Microsof...

    2.23.0               Microsoft.Graph.CloudCommunications PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Compliance          PSGallery            Microsof...

    2.23.0               Microsoft.Graph.CrossDeviceExper... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.DeviceManagement    PSGallery            Microsof...

    2.23.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Devices.CloudPrint  PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Devices.Corporat... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Devices.ServiceA... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.DirectoryObjects    PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Education           PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Files               PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Groups              PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Identity.Directo... PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Identity.Governance PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Identity.Partner    PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Identity.SignIns    PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Mail                PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Notes               PSGallery            Microsof...

    2.23.0               Microsoft.Graph.People              PSGallery            Microsof...

    2.23.0               Microsoft.Graph.PersonalContacts    PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Planner             PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Reports             PSGallery            Microsof...

    2.23.0               Microsoft.Graph.SchemaExtensions    PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Search              PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Security            PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Sites               PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Teams               PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Users               PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Users.Actions       PSGallery            Microsof...

    2.23.0               Microsoft.Graph.Users.Functions     PSGallery            Microsof...

    16.0.25221.12000     Microsoft.Online.SharePoint.Powe... PSGallery            Microsof...

    6.5.0                MicrosoftTeams                      PSGallery            Microsof...

    4.2.6                NTFSSecurity                        PSGallery            Windows ...

    1.4.8.1              PackageManagement                   PSGallery            PackageM...

    2.2.5                PowerShellGet                       PSGallery            PowerShe...

    0.1.0                SecMgmt                             PSGallery            Security...

    TLS Configuration

    Updated, still same error.

    Network Issues:

    Doubtful, all other cmdlets work. I can still use Get-Mailbox etc. when connected to Exchange Online

    Authentication Method:

    This is correct as my credentials to EXO force MFA every time.

    Session Persistence

    Still the same issue

    Command Limiting:

    Connect-ExchangeOnline -userprincipalname "my admin account" -CommandName {get-exomailbox "my regular user email"}

    New error...

    No cmdlet assigned to the user have this feature enabled.

    At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.6.0\netFramework

    \ExchangeOnlineManagement.psm1:766 char:21

    +                     throw $_.Exception;

    +                     ~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : OperationStopped: (:) [], UnauthorizedAccessException

        + FullyQualifiedErrorId : No cmdlet assigned to the user have this feature enabled.

    So let me throw this into the mix...

    I have a server that it DOES work on. Here are the installed modules on that server:

    3.0.7                ActiveDirectoryObjectPicker         PSGallery            Tulpep.A...

    2.9.0                Az.Accounts                         PSGallery            Microsof...

    1.1.2                Az.Advisor                          PSGallery            Microsof...

    4.2.0                Az.Aks                              PSGallery            Microsof...

    1.1.4                Az.AnalysisServices                 PSGallery            Microsof...

    3.0.0                Az.ApiManagement                    PSGallery            Microsof...

    1.1.0                Az.AppConfiguration                 PSGallery            Microsof...

    2.1.0                Az.ApplicationInsights              PSGallery            Microsof...

    1.0.0                Az.Attestation                      PSGallery            Microsof...

    1.7.3                Az.Automation                       PSGallery            Microsof...

    3.2.0                Az.Batch                            PSGallery            Microsof...

    2.0.0                Az.Billing                          PSGallery            Microsof...

    2.1.0                Az.Cdn                              PSGallery            Microsof...

    1.1.0                Az.CloudService                     PSGallery            Microsof...

    1.11.0               Az.CognitiveServices                PSGallery            Microsof...

    4.29.0               Az.Compute                          PSGallery            Microsof...

    3.1.0                Az.ContainerInstance                PSGallery            Microsof...

    3.0.0                Az.ContainerRegistry                PSGallery            Microsof...

    1.8.2                Az.CosmosDB                         PSGallery            Microsof...

    1.1.0                Az.DataBoxEdge                      PSGallery            Microsof...

    1.2.0                Az.Databricks                       PSGallery            Microsof...

    1.16.8               Az.DataFactory                      PSGallery            Microsof...

    1.0.2                Az.DataLakeAnalytics                PSGallery            Microsof...

    3.0.0                ExchangeOnlineManagement            PSGallery            This is ...

    1.13.0               Microsoft.Graph                     PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Applications        PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Authentication      PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Bookings            PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Calendar            PSGallery            Microsof...

    1.13.0               Microsoft.Graph.ChangeNotifications PSGallery            Microsof...

    1.13.0               Microsoft.Graph.CloudCommunications PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Compliance          PSGallery            Microsof...

    1.13.0               Microsoft.Graph.CrossDeviceExper... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.DeviceManagement    PSGallery            Microsof...

    1.13.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.DeviceManagement... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Devices.CloudPrint  PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Devices.Corporat... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Devices.ServiceA... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.DirectoryObjects    PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Education           PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Files               PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Financials          PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Groups              PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Identity.Directo... PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Identity.Governance PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Identity.SignIns    PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Mail                PSGallery            Microsof...

    1.13.0               Microsoft.Graph.ManagedTenants      PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Notes               PSGallery            Microsof...

    1.13.0               Microsoft.Graph.People              PSGallery            Microsof...

    1.13.0               Microsoft.Graph.PersonalContacts    PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Planner             PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Reports             PSGallery            Microsof...

    1.13.0               Microsoft.Graph.SchemaExtensions    PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Search              PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Security            PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Sites               PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Teams               PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Users               PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Users.Actions       PSGallery            Microsof...

    1.13.0               Microsoft.Graph.Users.Functions     PSGallery            Microsof...

    1.13.0               Microsoft.Graph.WindowsUpdates      PSGallery            Microsof...

    1.4.8.1              PackageManagement                   PSGallery            PackageM...

    2.2.5                PowerShellGet                       PSGallery            PowerShe...

    Any ideas?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-10-17T12:15:36+00:00

    Hi Dave McDonald DFO ,

    Good day.

    Thank you for posting to the Microsoft Community. We are glad to assist.

    It sounds like you’re encountering some connectivity issues with the Exchange Online PowerShell module. The errors you’re seeing, such as “The underlying connection was closed: An unexpected error occurred on a receive,” can be indicative of several potential problems. Here are a few troubleshooting steps you can try:

    Update the ExchangeOnlineManagement Module: Ensure you have the latest version of the module installed. You can update it by running:
    Install-Module -Name ExchangeOnlineManagement -Force

    TLS Configuration: The error message mentions SslProtocolType, which might be related to TLS settings. Make sure that your PowerShell session is using TLS 1.2 by running:
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

    Network Issues: Check for any network issues that might be causing the connection to drop. This could include firewall settings, proxy configurations, or intermittent network connectivity.

    Authentication Method: Since the V3 module uses REST API backed cmdlets, it’s possible that there’s an issue with the authentication method being used. Make sure that your credentials are correct and have the necessary permissions.

    Session Persistence: If the issue persists across multiple commands, it might be related to session persistence. Try explicitly disconnecting and reconnecting the session:
    Disconnect-ExchangeOnline -Confirm:$false Connect-ExchangeOnline -UserPrincipalName <yourUPN>

    Module Import: Sometimes, re-importing the module can resolve issues with cmdlet availability:
    Import-Module ExchangeOnlineManagement -Force

    Command Limiting: To avoid potential issues with loading all cmdlets, you can limit the cmdlets that are used in the session:
    Connect-ExchangeOnline -UserPrincipalName <yourUPN> -CommandName <cmdlet1>,<cmdlet2>,...

    Service Health: Check the health of the Exchange Online service to ensure there are no ongoing issues:
    Get-EXOServiceStatus

    If none of these steps resolve the issue, it might be helpful to provide more details about your environment, such as the version of PowerShell you’re using, the operating system, and any other relevant configuration information. This can help in diagnosing the problem further.

    If you’re still having trouble, you can try contacting Get support - Microsoft 365 admin | Microsoft Learn the support team will have access to assist remotely and collect logs to investigate the issue from the back end.

    I hope this helps let me know if this is contrary to what you need, I would still be helpful to answer more of your questions .

    Best Regards

    Community Moderator

    Was this answer helpful?

    0 comments No comments