Powershell timeout for O365 and Exchange Online
Please allow a configurable timeout for powershell when connecting to O365 and EO. The timeout is too short right now and the new login requirements make it tedious to reconnect
Ganesh G commented
When we have MFA enabled i dont think it is possible to extend seemless relogin. If any one had a lead to extend the session where MFA is enabled please drop me a note.
Skype for Business Online is also impacted by this.
I'm not sure why it's seen as "Idle" but I agree for long running scripts you definitely need the ability to extend the timeout.
Jeremy Bradshaw commented
FYI: Use Connect-ExoPSSession with the UserPrincipalName parameter and specify your UserPrincipalName along with it. This allows for seamless refresh token refreshing the (can't remember the name) other token - in other words seamless automatic re-logins.
Checkout my Connect-Exchange function (a.k.a. conex) which makes use of the EXO PS module from a regular PowerShell window. It also should have -UserPrincipalName provided for seamless / automatic re-logins. https://github.com/JeremyTBradshaw/PowerShell/blob/master/.functions/Connect-Exchange.ps1
For error handling to make your scripts able to deal with regular session drops to EXO, throttling, and more, checkout my script Get-ADAutoMappingFullAccessStatus.ps1: https://github.com/JeremyTBradshaw/PowerShell/blob/master/Get-ADAutoMappingFullAccessStatus.ps1. I still need to take the multi-catch by error type technique and turn it into a modular/reusable function, but the logic is shown there in the script. That script will run without error against any sized Exchange Online environment and not be phased by connection interruptions or throttling.
I am soon going to summarize the Exchange Online PowerShell error handling techniques I've/I'm learned/learning on my Wordpress site www.jb365.ca.
This needs to be made more extensible especially for long-running scripts.
Agreed. This makes it very difficult to run long-running commands (such as searching all recipients), as they time out before completion.