How to filter on FolderAndSubfolders from Get-exoMailboxFolderStatistics

SenhorDolas 1,191 Reputation points
2020-10-22T13:17:02.33+00:00

Hiya
I am trying to filter on mailboxes with FolderAndSubfolders size greater than 300MB and nothigs comes up even thou I am many.

This is the script that I am using

 Get-exoMailbox -ResultSize unlimited |Get-exoMailboxFolderStatistics  -FolderScope RecoverableItems | ?{$_.FolderAndSubfolders -lt 500MB}

Is there a way to make this filter work?
SD

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,369 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,389 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 96,161 Reputation points MVP
    2020-10-22T13:28:18.233+00:00

    There's no property called "FolderAndSubfolders", make sure you use the full name. Also, as this is a string value, you cannot do direct comparison against a value of 500MB, you have to convert it first.

    Here's an example that should work:

    Get-MailboxFolderStatistics vasil -FolderScope recover | ? {[double]((($_.FolderAndSubfolderSize).split("("))[1]).Split(" ")[0] -gt "500MB"}
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful