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
cyberleo2000Asked:
Who is Participating?
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:
Hi,

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.
0
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.
0
Amit KumarCommented:
Hi,

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)
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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
0
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

0

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.
0
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
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.