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: exchange/docs-conceptual/exchange-online-powershell-v2.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: About the Exchange Online PowerShell V2 module and V3 module
3
3
ms.author: chrisda
4
4
author: chrisda
5
5
manager: dansimp
6
-
ms.date: 6/21/2023
6
+
ms.date: 7/5/2023
7
7
ms.audience: Admin
8
8
audience: Admin
9
9
ms.topic: article
@@ -62,13 +62,15 @@ Version 3.0.0 or later is known as the EXO V3 module. The EXO V3 module improves
62
62
63
63
- REST API cmdlets have the same cmdlet names and work just like their remote PowerShell equivalents, so you don't need to update any of your scripts.
64
64
65
+
The [Invoke-Command](/powershell/module/microsoft.powershell.core/invoke-command) cmdlet doesn't work in REST API connections. For alternatives, see [Workarounds for Invoke-Command scenarios in REST API connections](invoke-command-workarounds-rest-api.md).
66
+
65
67
- In Exchange Online PowerShell and in Security & Compliance PowerShell, all of the available remote PowerShell cmdlets are backed by the REST API.
66
68
67
69
- In Exchange Online PowerShell and in Security & Compliance PowerShell, REST API connections are used by default. You need to use the _UseRPSSession_ switch in the **Connect-ExchangeOnline** or **Connect-IPPSSession** command to access cmdlets in remote PowerShell mode.
68
70
69
71
- Consider the following items if you connect to Exchange Online PowerShell or Security & Compliance PowerShell in remote PowerShell mode:
70
72
-[Basic authentication in WinRM](#turn-on-basic-authentication-in-winrm) is required on your client computer.
71
-
- If you don't connect i remote PowerShell mode, you have access to REST API cmdlets _only_.
73
+
- If you don't connect in remote PowerShell mode, you have access to REST API cmdlets _only_.
72
74
- The end of remote PowerShell support in Exchange Online PowerShell has been announced. For more information, see [Announcing Deprecation of Remote PowerShell (RPS) Protocol in Exchange Online PowerShell](https://aka.ms/RPSDeprecation).
73
75
74
76
- A few REST API cmdlets in Exchange Online PowerShell have been updated with the experimental _UseCustomRouting_ switch. This switch routes the command directly to the required Mailbox server, and might improve overall performance.
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/invoke-command-workarounds-rest-api.md
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: Workarounds
2
+
title: Workarounds for Invoke-Command scenarios in REST API connections
3
3
ms.author: chrisda
4
4
author: chrisda
5
5
manager: dansimp
6
-
ms.date:
6
+
ms.date:7/5/2023
7
7
ms.audience: Admin
8
8
audience: Admin
9
9
ms.topic: article
@@ -17,16 +17,19 @@ search.appverid: MET150
17
17
description: "Learn about the alternatives to Invoke-Command commands in REST API connections using the EXO V3 module."
18
18
---
19
19
20
-
# Workarounds
20
+
# Workarounds for Invoke-Command scenarios in REST API connections
21
21
22
-
In multiple remote PowerShell connections to Exchange Online in the same window, you use the [Invoke-Command](/powershell/module/microsoft.powershell.core/invoke-command) cmdlet to run scripts or commands in specific remote PowerShell sessions. But, the **Invoke-Command** cmdlet doesn't work in [REST API connections](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module) to Exchange Online PowerShell.
22
+
In multiple connections to Exchange Online or Security & Compliance PowerShell in the same window, you use the [Invoke-Command](/powershell/module/microsoft.powershell.core/invoke-command) cmdlet to run scripts or commands in a specific remote PowerShell session. But, the **Invoke-Command** cmdlet doesn't work in [REST API connections](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module) to Exchange Online or Security & Compliance PowerShell.
23
23
24
24
This article offers REST API alternatives for scenarios that that use **Invoke-Command** commands.
25
25
26
26
## Scenario 1: Run Exchange Online cmdlets
27
27
28
28
This example finds the identity of any other user (`$Us = $User.Identity`).
29
29
30
+
> [!TIP]
31
+
> Other commands were required to get the values of `$User` and therefore `$Us`. Those commands aren't important. The overall approach that's being used is what's important.
32
+
30
33
-**In a remote PowerShell session**: Use the **Get-PSSession** cmdlet to store the remote PowerShell session details in the variable named `$Session`, and then run the following command:
31
34
32
35
```powershell
@@ -110,15 +113,15 @@ This example shows how to create two PowerShell sessions in the same window and
110
113
5. Now you can run commands in either session. For example:
0 commit comments