cfr microsoft note : CVE-2023-23397 script - Microsoft - CSS-Exchange
powershell in admin mode
Connect-MSOLService
Install-Module AzureAD
import-Module ExchangeOnlineManagement
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.1.0
Connect-ExchangeOnline -UserPrincipalName user@domein.be
- .\CVE-2023-23397.ps1 -CreateAzureApplication

- download : https://api.nuget.org/v3-flatcontainer/microsoft.exchange.webservices/2.2.0/microsoft.exchange.webservices.2.2.0.nupkg
- unzip
- download script : https://github.com/microsoft/CSS-Exchange/releases/latest/download/CVE-2023-23397.ps1
- run in elevated powershell : Get-Mailbox | .\CVE-2023-23397.ps1 -Environment "Online"

- .\CVE-2023-23397.ps1 -DeleteAzureApplication