Last active
September 8, 2021 17:09
-
-
Save JustinGrote/0f1ed01cf8a6684e82812cbe2013b04d to your computer and use it in GitHub Desktop.
Revisions
-
JustinGrote revised this gist
Jul 3, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ for ($i=1;$i -le 5;$i++) { try { Connect-ExchangeOnline -Credential $Credential -Verbose:$false -ShowProgress $false -Force -WarningAction silentlycontinue 6>$null } catch { if ($i -ge 2) {Write-Warning "Connect-ExchangeOnline Retry $i"} [float]$sleepTimer = [Math]::Pow(2,$i) + [float]((Get-Random -Max 1000) /1000 ) -
JustinGrote created this gist
Jul 3, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ for ($i=1;$i -le 5;$i++) { try { Connect-ExchangeOnline -Credential $SeasonsAADCredential -Verbose:$false -ShowProgress $false -Force -WarningAction silentlycontinue 6>$null } catch { if ($i -ge 2) {Write-Warning "Connect-ExchangeOnline Retry $i"} [float]$sleepTimer = [Math]::Pow(2,$i) + [float]((Get-Random -Max 1000) /1000 ) Write-Warning "Connect-ExchangeOnline PS Remoting Error (retry: $sleeptimer sec): $PSItem" Start-Sleep $sleeptimer continue } } if ($i -ge 5) {Write-Warning "Connect-ExchangeOnline backoff retry timer reached."}