Checking the exchange email numbers

Posted by Miksu22@reddit | sysadmin | View on Reddit | 18 comments

Hi,
We recently encountered a problem where one of our employees email inboxes reached their maximum capacity. My supervisor told me to check how many emails each employee has, including the CEO, and to enforce company-wide policies to keep it under the maximum limit per user. I feel like people use their deleted folders as an "archive" for things, so I would like to check if they are full of stuff before I start purging them. I am operating from a Mac, but we mainly use Windows. I tried to check this using PowerShell, but I received an error when trying to access our Exchange server. I have the necessary admin rights to assign "read and manage" rights to anyone's inbox, but I am concerned that I might get into trouble for doing so, especially because we are also subject to EU user privacy laws. We don't have an Azure subscription to use cloud-based PowerShell. I normally do network stuff, so I'm a bit lost with this one, to be honest. Any ideas how to proceed from here?
I am running macOS 26.5.0 and powershell 7.6.2.

I tried to use devicecode and usedeviceauthentication, but neither of those worked.