Script to find specific folder name - search all Exchange mailboxes.

I need to search all our exchange mailboxes to find a specific folder name. I am trying this but it is taking a long time and may error out. Any suggestions?


Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics | Where {$_.Name -Match “ND -Archived (View Only)”} | Export-Csv C:/temp/Users_Folder_Size.csv


Thank you.

Hello DZuver58,

If your mailboxes are on Office365 when you are creating a session to O365 try to increase IdleTimeout parameter.

For Example Using ExchangeOnlineShell module:

Connect-ExchangeOnlineShell -IdleSessionTimeout Max

As far as I know the max value is 43200000 (12 hours)


Hope that helps.