Microsoft is phasing out the use of Remote PowerShell for Exchange Online, and will block its use next year. Remote PowerShell for Exchange Online will get blocked starting on June 1, 2023, per a ...
Don’t copy and paste the same code over and over again. Instead, create a PowerShell function and save yourself time.