You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/en/Other/exologinfails.md
+48-8Lines changed: 48 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -8,30 +8,70 @@ date: '2025-04-06'
8
8
---
9
9
10
10
11
-
ExchangeOnlineManagement fails to connect
12
-
11
+
# ExchangeOnlineManagement fails to connect
13
12
13
+
```powershell
14
14
Connect-ExchangeOnline -UserPrincipalName
15
15
InvalidOperation: You cannot call a method on a null-valued expression.
16
+
```
16
17
17
18
18
-
Check how many you have. If it's more than one, it is likely to cause an issue. Unless you have a very good reason to keep multiple versions, it's best to have only **one**.
When trying to connect to Exchange Online using the **Connect-ExchangeOnline** cmdlet from the ExchangeOnlineManagement PowerShell module, you might encounter the following error:
19
21
20
-
```powershell
21
-
get-module -ListAvailable | where {$_.Name -match "Exchange"}
22
+
>> InvalidOperation: You cannot call a method on a null-valued expression.
23
+
24
+
25
+
This error typically indicates that something went wrong during the initialization of the module or authentication process.
22
26
23
27
28
+
Check how many ExchangeOnlineManagement modules you have. If it's more than one, it is likely to cause an issue. Unless you have a very good reason to keep multiple versions, it's best to have only **one**.
29
+
30
+
```powershell
31
+
Get-Module -ListAvailable | where {$_.Name -match "Exchange"}
32
+
```
33
+
24
34
Uninstall all your modules. It will allow for a clean start.
0 commit comments