How do I convert Exchange mailbox statistics to a number in Exchange Online?

When I run Get-MailboxStatistics <mailbox> | FL TotalDeletedItemSize , I get something like this:

TotalDeletedItemSize : 1.835 GB (1,970,288,464 bytes)

How do I convert this to a number? for example: 1.835

I've tried things like this: (Get-MailboxStatistics <mailbox>).TotalItemSize.value.tomb()

But apparently this is not available in Exchange Online.

I am trying to right a script that will output the name of mailboxes with a dumpster size greater than 25 GB

thank you
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Amit KumarCommented:

As per this article, same powershell cmdlet works on Exchange online.

Below content from mentioned article.

This cmdlet is available in on-premises Exchange Server 2013 and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.
Use the Get-MailboxStatistics cmdlet to obtain information about a mailbox, such as the size of the mailbox, the number of messages it contains, and the last time it was accessed. In addition, you can get the move history or a move report of a completed move request.
cyberleo2000Author Commented:
I guess I did not make myself clear, the TotalItemSize.value.tomb() part is not available in Exchange Online, at least, not in this format.
Amit KumarCommented:

I have Office 365 with me and connected with Remote powershell, I am able to find results by below command:

Get-MailboxStatistics <Nameofuser> | fl *total*

TotalDeletedItemSize     : 2.566 MB (2,690,829 bytes)
TotalItemSize            : 962.4 KB (985,468 bytes)
MessageTableTotalSize    : 3.813 MB (3,997,696 bytes)
AttachmentTableTotalSize : 832 KB (851,968 bytes)
OtherTablesTotalSize     : 1.25 MB (1,310,720 bytes)
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

cyberleo2000Author Commented:
ok, let me put this another way. I need a powershell script that will output the name of mailboxes where TotalDeletedItemSize is larger than 25 GB.

thank you
Amit KumarCommented:
Please use below one:

Note: value is compared in bytes (so converted 25 Gb in bytes).

For single mailbox

Get-MailboxStatistics <Username> | Where-Object {$_.TotalDeletedItemSize -gt 26843545600} | ft DisplayName, *total*

Open in new window

For all mailboxes

get-mailbox | Get-MailboxStatistics  | Where-Object {$_.TotalDeletedItemSize -gt 26843545600} | ft DisplayName, *total*

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cyberleo2000Author Commented:
thank you very much.

I was using Get-Mailbox | Get-MailboxStatistics  | Where TotalDeletedItemSize -GT 26843545600 and getting a format error.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.