Hi
Thanks for posting your question in the Microsoft Q&A forum.
Andy is right, here are my additions.
We cannot add columns for CustomAttribute in Exchange Online. The old Get-Mailbox cmdlet will retrieve all of the mailbox properties. The new Get-EXOMailbox, by default, will only retrieve a minimum set of properties. To include additional properties to the minimal output you can use the Properties parameter. So for your issue, we should refer to the followings:
Get-EXOMailbox -Properties CustomAttribute7 | Where{$_.CustomAttribute7 -eq 'exo'} | select UserPrincipalName
https://www.easy365manager.com/get-exomailbox/
If my answer is helpful to you, please mark it as the answer so that other users can refer to it. Thank you for your support and understanding.