Exchange Online PowerShell uses Remote PowerShell to connect to Exchange Online tenant and perform various management tasks such as creating and managing mailboxes, automating tasks, creating reports, performing bulk operations on multiple accounts, and configuring various settings.
Recently Microsoft made announcement regarding deprecation of Remote PowerShell (RPS) in Exchange Online. Starting from June 1, 2023, Microsoft will begin phasing out the use of Remote PowerShell (RPS) for Exchange Online, with a complete cut-off on July 1, 2023.
If you are using any of the below methods, you are utilizing Remote PowerShell.
- Exchange session creation using New-PSSession
- Connect to Exchange Online PowerShell using Connect-ExoPSSession (EXO V1 module)
- Usage of Exchange Online PowerShell V2 module
- Using –UseRPSSession parameter
Admins can adopt the below alternatives to avoid the usage of RPS.
- If you are using the New-PSSession or Connect-EXOPSSession to connect Exchange Online PowerShell, install EXO V3 module and use the Connect-ExchangeOnline cmdlet.
- Avoid using Connect-ExchangeOnline cmdlet with –UseRPSSession parameter and use REST API cmdlets.
By using Exchange Online PowerShell V3 (EXO V3) module, admins can mitigate the effects of RPS retirement.
To check the current version of EXO module, run the following cmdlet.
In the above example, EXO V2 module is installed. To upgrade the Exchange Online PowerShell module to V3, run the below cmdlet.
Update-Module -Name ExchangeOnlineManagement
In the above image, Exo V2 module updated to the EXO V3 module.
If you haven’t installed Exchange Online Management module earlier, you can install the latest EXO module using the following cmdlet.
Install-Module –Name ExchangeOnlineManagement
To precise, if you want to install a specific version, you can pass it in the –RequiredVersion parameter. For example,
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.0.0
Updated on May 23
Recently, Microsoft provided an option to re-enable RPS (if Microsoft had disabled it for you) and use it for a little longer. The self-service tool in the Microsoft 365 admin center and the Exchange admin center that admins can use to request an extension or re-enablement of RPS.
Step1: You can go to the RPS self-service tool by clicking on the below link.
Step2: You will see the below in the self-service help system.
To determine if RPS has been disabled for your tenant, click “Run Tests” and review the results. If RPS has not been disabled and you are running the diagnostic, you will be provided with the option to temporarily opt out of RPS disablement or re-enable RPS.
Step3: Click the checkbox and then click Update.
Upon submitting the opt-out request, RPS will not be disabled for your tenant, in accordance with the timeline outlined below.
- March 2023: Current WW tenants can opt-out of RPS deprecation until September 2023.
- April 2023: WW tenants created on or after April 1st can re-enable RPS until June 2023. New tenants created after July 2023 cannot re-enable RPS.
- May 2023: RPS is disabled for WW tenants created before April, unless re-enabled using the diagnostic until September 2023.
- June 15, 2023: RPS is disabled for WW tenants who have not opted-out or re-enabled it yet and have previously used it. Re-enablement possible until September 2023 (unless tenant was created after April 2023).
- July 2023: RPS is permanently disabled for WW tenants created after July 1st. Diagnostics cannot re-enable RPS for these tenants. Tenants must use Exchange Online PowerShell v3 module without the UseRPSSession parameter.
- September 2023: RPS opt-out/re-enablement diagnostic for WW tenants is retired.
- October 2023: RPS is blocked for all tenants, regardless of creation date or opt-out status. All tenants must use Exchange Online PowerShell v3 module without the UseRPSSession parameter.
Starting July 15, 2023, Microsoft will start deprecating the legacy RPS protocol in the Security and Compliance PowerShell module.
The New REST API will offer the same cmdlets and feature compatibility as the existing RPS v1 cmdlets. This means that there is no need to update existing scripts or processes. By utilizing the new PowerShell module version 3.2.0-Preview3, the REST API will be automatically used instead of RPS.
- Install the Exchange Online Management v3 module version 3.2.0-Preview3
Install-Module -Name ExchangeOnlineManagement -AllowPrerelease
- Create PowerShell session to SCC
Note: After the general release of this module version, the need for the “UseRPSSession:$false” parameter will be eliminated.
Many administrators are already facing challenges in migrating from Azure AD and MSOL modules to Microsoft Graph PowerShell, the retirement of RPS has a positive aspect. The REST API cmdlets for Exchange Online PowerShell are identical to the existing RPS-based cmdlets, which means that administrators do not need to update the cmdlets in their existing scripts. They only need to update the module, making the transition less complex and less time-consuming.
To learn more about the upcoming deprecations in Office 365 and how to stay ahead of the curve, be sure to check out the in-depth blog at 2023 End-of-support milestones in Office 365.