multiple tenant – Microsoft Graphical API – list of mailboxes

I want to create an application or a way to list all the mailboxes of an Office 365 account. And I'm talking about an account that does not belong to me.
I've read a few articles that explain how to create a multi-tenant Azure application and that the tenant's administrator can grant permissions to read the details of the user, but that's in the AD context and not what I'm looking for.

In the O365 administration, there is an Exchange Administration Center in which all mailboxes are configured. I want to run a script / application to retrieve these addresses, as well as other organization-related information, such as the service, and so on. (of course, with consent).

I guess I will not have access to AD and it is not good to have contacts because I want contacts belonging to the organization and not personal contacts.

I would love to have a clue.