jborean93 / omi

Open Management Infrastructure
Other
108 stars 13 forks source link

Unable to connect to Exchange Online (MI_RESULT_FAILED) #52

Closed pdf closed 2 years ago

pdf commented 2 years ago
SUMMARY

Attempting to connect to Exchange Online via ExchangeOnlineManagement/Connect-ExchangeOnline results in the following error after successful authentication via browser:

Exception: Connecting to remote server outlook.office365.com failed with the following error message : MI_RESULT_FAILED For
more information, see the about_Remote_Troubleshooting Help topic.

Debug logs below:

2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45297 Priority=DEBUG MI_Client Application Initialize: application=0x7f85781a4010, internal-application=0x7f857818b4d0
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45283 Priority=DEBUG Enter Application_NewSession with application (0x7f85781a4010), protocol (null), destination(outlook.office365.com), session (0x7f85781b80b8).
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45293 Priority=DEBUG Enter Session_Create with application (0x7f85781a4010), protocol (null), destination(outlook.office365.com), session (0x7f85781b80b8).
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_ImpersonateClientInternal
2022/07/26 02:42:21 [455988,456187] DEBUG: null(0): EventId=45142 Priority=DEBUG InteractionProtocolHandler_Protocol_RunThread
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45303 Priority=DEBUG MI_Client Session Create: application=0x7f85781a4010, session=0x7f85781b80b8, internal-session=0x7f8570004f40
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_RevertImpersonation
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45284 Priority=DEBUG Leave Application_NewSession with session (0x7f85781b80b8).
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45295 Priority=DEBUG Enter Session_AccessCheck - session (0x7f85781b80b8)
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45289 Priority=DEBUG Increase refcount for thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45290 Priority=DEBUG Get correct thunk handle 0x7f85877fb750 from generic handle: 0x7f85781b80b8
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45288 Priority=DEBUG Decrease refcount without release thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45296 Priority=DEBUG Leave Session_AccessCheck on session (0x7f85781b80b8) with for operation (create instance).
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_GetApplication
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45289 Priority=DEBUG Increase refcount for thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45290 Priority=DEBUG Get correct thunk handle 0x7f85877fb760 from generic handle: 0x7f85781b80b8
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45288 Priority=DEBUG Decrease refcount without release thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_GetProtocolHandlerSession
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45289 Priority=DEBUG Increase refcount for thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45290 Priority=DEBUG Get correct thunk handle 0x7f85877fb760 from generic handle: 0x7f85781b80b8
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45288 Priority=DEBUG Decrease refcount without release thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_ImpersonateClient
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_GetProtocolHandlerApplication
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45289 Priority=DEBUG Increase refcount for thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45290 Priority=DEBUG Get correct thunk handle 0x7f85877fb760 from generic handle: 0x7f85781b80b8
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45288 Priority=DEBUG Decrease refcount without release thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45292 Priority=DEBUG Session called: Session_RegisterOperation
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45289 Priority=DEBUG Increase refcount for thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45290 Priority=DEBUG Get correct thunk handle 0x7f85877fb750 from generic handle: 0x7f85781b80b8
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45288 Priority=DEBUG Decrease refcount without release thunk handle: 0x7f85781acd90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45289 Priority=DEBUG Increase refcount for thunk handle: 0x7f85781afa90
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): EventId=45325 Priority=DEBUG MI_Client Operation Create Instance: session=0x7f85781b80b8, operation=0x7f85781b80d0, internal-operation=0x7f8578035180, namespace=<null>
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): _CreateConnectorSocket - Begin. host: outlook.office365.com, port: 443, secure? 1
2022/07/26 02:42:21 [455988,456014] DEBUG: null(0): _CreateSocketAndConnect - Begin
2022/07/26 02:42:22 [455988,456014] ERROR: null(0): _CreateSocketAndConnect - Sock_Connect failed. result: 1 (MI_RESULT_FAILED)
2022/07/26 02:42:22 [455988,456014] DEBUG: null(0): EventId=45355 Priority=DEBUG Sock_Close: sock (152)
2022/07/26 02:42:22 [455988,456014] WARNING: null(0): _CreateConnectorSocket - _CreateSocketAndConnect of primary address failed. result: 1 (MI_RESULT_FAILED)
2022/07/26 02:42:22 [455988,456014] DEBUG: null(0): _CreateSocketAndConnect - Begin
2022/07/26 02:42:23 [455988,456014] ERROR: null(0): _CreateSocketAndConnect - Sock_Connect failed. result: 1 (MI_RESULT_FAILED)
2022/07/26 02:42:23 [455988,456014] DEBUG: null(0): EventId=45355 Priority=DEBUG Sock_Close: sock (152)
2022/07/26 02:42:23 [455988,456014] ERROR: null(0): _CreateConnectorSocket - Addr_Init failed. result: 1 (MI_RESULT_FAILED)
2022/07/26 02:42:23 [455988,456014] ERROR: null(0): HttpClient_New_Connector - _CreateConnectorSocket failed. result: 1 (MI_RESULT_FAILED)
2022/07/26 02:42:23 [455988,456014] DEBUG: null(0): EventId=45128 Priority=DEBUG InteractionProtocolHandler_Operation_Strand_Post: 0x7f8578192480, msg(0x7f8578272d98:4:PostResultMsg:0)
2022/07/26 02:42:23 [455988,456014] DEBUG: null(0): EventId=45129 Priority=DEBUG MI_Result = MI_RESULT_FAILED
2022/07/26 02:42:23 [455988,456014] DEBUG: null(0): EventId=45307 Priority=DEBUG MI_Client Operation Instance Result (async): session=0x7f85781b80b8, operation=0x7f85781b80d0, internal-operation=0x7f8578035180, resultCode=1, moreResults=FALSE
LIBMI VERSION

The powershell script in the issue template (https://github.com/jborean93/omi/.github/tools/Get-OmiVersion.ps1) is missing.

Get-WSManVersion

MI       PSRP
--       ----
2.3.0.31 2.3.0.31
OS / ENVIRONMENT

Arch Linux

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Linux 5.18.12-zen1-1-zen-custom #1 ZEN SMP PREEMPT_DYNAMIC Sat, 16 Jul 2022 16:00:01 +0000
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
pdf commented 2 years ago

I force-updated the EXOv2 module, not sure if it was that or MS fixed something server-side, but this appears to be working again now.