I'm trying to search for a mailbox from the exchange server using EWS service as below.
ewsClient.ResolveName("roomname@microsoft.com", ResolveNameSearchLocation.DirectoryThenContacts, true, props)
But it always returns an empty list means there is no mailbox in the exchange server having this address. Actually, that mailbox exists in exchange server and we can access it through PowerShell using
Get-Mailbox "roomname@microsoft.com"
Both EWS and PowerShell accessed using the same service account.
What's the issue might be?
The ResolveName operation in EWS will only return results for objects that are visible in the Global Address List. Get-Mailbox and the hiddenfromaddresslistsenabled property will show if its been hidden from the GAL.