I'm trying to get all users that use mailboxes less than 0.5GB and set them to 0.5GB. By default all new mailboxes are set to 2GB.
get-mailbox -ResultSize unlimited|Get-MailboxStatistics | Where {$_.TotalItemSize -lt 0.5GB}
Where : Cannot compare "984.1 MB (1,031,912,881 bytes)" to "536870912" because the objects are not the same type or the object "984.1 MB (1,031,912,881
bytes)" does not implement "IComparable".
At line:1 char:59
+ get-mailbox -ResultSize unlimited|Get-MailboxStatistics | Where {$_.TotalItemSiz ...
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Where-Object], ExtendedTypeSystemException
+ FullyQualifiedErrorId : PSObjectCompareTo,Microsoft.PowerShell.Commands.WhereObjectCommand