How to Handle Ex43C0AC|Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException in PowerShell

251 Views Asked by At

I am running below ExchangeOnline command for thousands of user, and for few of them I am getting bello exception. I am using try-catch, even though this exception is not handled and it is thrown on console. Could you please help me catch this exception?

try{
    Get-ActiveSyncDeviceStatistics -mailbox <mailbox UPN>
}
catch
{
    $_.Exception
}

Eception thrown on console: Get-ActiveSyncDeviceStatistics: Ex43C0AC|Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException|The operation couldn't be performed because '[email protected]' couldn't be found.

I have tried normal try-catch block.

0

There are 0 best solutions below