2 years ago
#64465
Andreee
exchange online - The I / O operation was aborted
I running a simple code:Set-MailboxCalendarConfiguration on about 700 users but I keep getting The I / O operation was aborted error.
I thought it was a session issue so I added to code $EOLSession.state -eq 'Broken' -or !$EOLSession
That did not work. So I googled more and i found that it might be related to WinRM service so I added more code. That also did not work ...I can't find anything else. Can someone help me please?
my code is below:
foreach ($user in $users) {
try
{
Function Reconnect-ExchangeOnline
{
if ($EOLSession.state -eq 'Broken' -or !$EOLSession)
{
Disconnect-ExchangeOnline; Start-Sleep -Seconds 3; Connect-ExchangeOnline
}
}
$serviceWinRM = get-service WinRM
if ( $serviceWinRM.Status -eq "Stopped")
{
start-service WinRM;Start-Sleep -Seconds 4
}
Set-MailboxCalendarConfiguration -identity $user.userprincipalname -WorkDays Weekdays -WeekStartDay "Monday"
}
catch
{
$Error[0].Exception.GetType().FullName
Connect-ExchangeOnline -UserPrincipalName xxxxxx
}}
powershell
office365
exchange-server
0 Answers
Your Answer