Office 365 - PowerShell script error. Exception of type 'System.InvalidOperationException'

Hi Folks,

I'm currently having the issue with all of my Office 365 monitoring Application component (SAM).

All of them showing PowerShell script error. Exception of type 'System.InvalidOperationException' was thrown. issue and thousands of emails are triggered every hour.

Where can I view the detailed error?



Note: the Service account is working fine (AD Account not locked) and I can use it to login and test some cmdlets.

Top Replies

  •  Have you tried using new API Poller feature instead? 2020.2.1 Release has out of the box API Poller template that substitute the Office 365 Powershell template. It's named: "Microsoft 365 Exchange…

Parents Reply
  •  I meant API Poller feature that was added to SAM one year ago.

    If you are on SAM 2020.2.1 go to Node in SAM that is used for M365.

    Click API Poller Management -> Assign

    Search for "Microsoft 365 Exchange Online" and select it and click next.

    Select OAuth2.0 and click "new credential"

    Provide your M365 data, SCOPE should be set to:

    Click "Assign Pollers"

    API Poller will be created. Click on "Microsoft 365 Exchange Online" link

    In the URL update the ${TENANT_ID} value. You should see below screen: