Score:1

Compliance search initialization for "task search1" failed with exception: Object reference not set to an instance of an object

in flag

I've a script to start a Search task on Content Search, of Compliance.

If I use my own user account to login, I am able to run it, but if I use an unattended login through an App, like the one of App-only authentication in Exchange Online PowerShell and Security & Compliance PowerShell | Microsoft Learn, I receive the following error:

enter image description here

From compliance perspective I got this, an empty search:

enter image description here

I've given a Global Admin role to the App. From app only authentication/login, there is no issue with that.

ExchangeOnlineManagement version that Iam using is 2.0.6-Preview7.

Anyone knows how can I solve this?

Thank you in advance!

Pimp Juice IT avatar
ch flag
Have a read here https://www.codetwo.com/admins-blog/new-compliancesearch-new-version-of-search-mailbox/, may be that Global Admin doesn't have the 'Compliance' permissions for the necessary modules needed. I've not used apps to do this sort of thing, but for ediscovery and compliance cmdlets, you might need to assign the app those roles talked about in that post. I read a different post that eluded to the account doing the search not having an Exchange mailbox and getting a similar error, but not 100% the same. Consider figuring out he necessary roles and removing Global Admin to further test
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.