Exchange:how to get Mailbox size in Exchange Shell?

Source: Internet
Author: User
Tags get mailbox size

Get-mailboxstatistics cmdlet gives Totalitemsize which is the mailbox size. But the totalitemsize doesn ' t contain the mailbox size in numbers, it ' s a PowerShell deserialized object.

This command displays the mailbox size from the Value property:

(get-mailboxstatistics-identity username). Totalitemsize.value

Example output:10.43 GB (11,202,063,583 bytes)

But what to do it usable in creating reporting or other purpose.  Convert that value to a string, split at ' (' and take the first item in the split array. Here's the command that gives you usable mailbox size.

(get-mailboxstatistics-identity username). TotalItemSize.Value.ToString (). Split ("(") [0]

Example output:10.43 GB

If you want in the bytes, use the This cmdlet:

(get-mailboxstatistics-identity username). TotalItemSize.Value.ToString (). Split ("(") [1]. Split ("") [0]. Replace (",", "")

Example output:11202063583

Hope It is helpful for you.

Exchange:how to get Mailbox size in Exchange Shell?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.