The process of building custom applications and tools that interact with Microsoft Exchange Server
All Outlook users are located in Exchange Online
What's your reason for using EWS to do this ? why not just use the Powershell graph sdk eg
Get-MgUserMailFolder -MailFolderId MsgFolderRoot -UserId user@keyman
its a lot simpler logic and supports all the different Auth scheme eg client_credentials etc, EWS is considered legacy and may go away at some point in the future the only reason to use it is if you have hybrid mailboxes or OnPrem.